blob: a65d420b70e531e3552e499d80f5e989882a52da [file] [log] [blame]
---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
- hosts: localhost
vars:
kubespray_remote_ssh_user: "cord"
tasks:
# Edit all.yml variable file
- name: Add lines to the all.yaml variable file
lineinfile:
path: inventories/{{ deployment_name }}/group_vars/all/all.yml
line: "{{ item }}"
with_items:
- 'ansible_python_interpreter: /usr/bin/python2.7'
- 'ansible_user: {{ kubespray_remote_ssh_user }}'
- 'ansible_become: true'
- 'kube_feature_gates: [SCTPSupport=true]'
- 'kube_network_plugin: calico'
- 'kube_network_plugin_multus: true'
- 'calico_version: v3.4.0'
- 'calico_cni_version: v3.4.0'
# Edit k8s-cluster.yml variable file
- name: Set Docker DNS servers strict to false
lineinfile:
path: inventories/{{ deployment_name }}/group_vars/k8s-cluster/k8s-cluster.yml
regexp: '^#\s*docker_dns_servers_strict.*$'
line: 'docker_dns_servers_strict: false'
- name: Set Helm enabled to true
lineinfile:
path: inventories/{{ deployment_name }}/group_vars/k8s-cluster/k8s-cluster.yml
regexp: '^helm_enabled.*$'
line: 'helm_enabled: true'
- name: Set kubeconfig localhost to true
lineinfile:
path: inventories/{{ deployment_name }}/group_vars/k8s-cluster/k8s-cluster.yml
regexp: '^#\s*kubeconfig_localhost.*$'
line: 'kubeconfig_localhost: true'
- name: Allow insecure registry access
lineinfile:
path: inventories/{{ deployment_name }}/group_vars/k8s-cluster/k8s-cluster.yml
regexp: 'docker_options'
line: "docker_options: \"{{ item }} --insecure-registry={{ '{{' }} kube_service_addresses {{ '}}' }} --graph={{ '{{' }} docker_daemon_graph {{ '}}' }} {{ '{{' }} docker_log_opts {{ '}}' }}\"" # noqa 204
with_items: "{{ k8s_nodes.split(' ') | map('regex_replace', '(.*)', '--insecure-registry=\\1/32') | join(' ') }}"