summaryrefslogtreecommitdiffstats
path: root/playbooks/common
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-11-21 16:56:27 -0500
committerGitHub <noreply@github.com>2017-11-21 16:56:27 -0500
commit8255f668ebac12171098f5ba6cbb74370ec3141c (patch)
tree005604559faa06dcb5cae42c50dd1f47b594fb20 /playbooks/common
parent51a0cbd42807c91a5e30fa58362b8745a40607f2 (diff)
parent37cfec7fd40bc77c53368e8fc934d551d773c9bd (diff)
downloadopenshift-8255f668ebac12171098f5ba6cbb74370ec3141c.tar.gz
openshift-8255f668ebac12171098f5ba6cbb74370ec3141c.tar.bz2
openshift-8255f668ebac12171098f5ba6cbb74370ec3141c.tar.xz
openshift-8255f668ebac12171098f5ba6cbb74370ec3141c.zip
Merge pull request #6158 from mtnbikenc/consolidate-openshift-node
Playbook Consolidation - openshift-node
Diffstat (limited to 'playbooks/common')
-rw-r--r--playbooks/common/openshift-cluster/config.yml2
-rw-r--r--playbooks/common/openshift-cluster/redeploy-certificates/openshift-ca.yml2
-rw-r--r--playbooks/common/openshift-master/scaleup.yml4
-rw-r--r--playbooks/common/openshift-node/additional_config.yml64
-rw-r--r--playbooks/common/openshift-node/certificates.yml8
-rw-r--r--playbooks/common/openshift-node/clean_image.yml10
-rw-r--r--playbooks/common/openshift-node/config.yml38
-rw-r--r--playbooks/common/openshift-node/configure_nodes.yml17
-rw-r--r--playbooks/common/openshift-node/containerized_nodes.yml19
-rw-r--r--playbooks/common/openshift-node/enable_excluders.yml8
-rw-r--r--playbooks/common/openshift-node/etcd_client_config.yml11
l---------playbooks/common/openshift-node/filter_plugins1
-rw-r--r--playbooks/common/openshift-node/image_prep.yml21
l---------playbooks/common/openshift-node/lookup_plugins1
-rw-r--r--playbooks/common/openshift-node/manage_node.yml12
-rw-r--r--playbooks/common/openshift-node/network_manager.yml28
-rw-r--r--playbooks/common/openshift-node/restart.yml61
l---------playbooks/common/openshift-node/roles1
-rw-r--r--playbooks/common/openshift-node/setup.yml27
19 files changed, 4 insertions, 331 deletions
diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml
index 77b7a903f..81b163b80 100644
--- a/playbooks/common/openshift-cluster/config.yml
+++ b/playbooks/common/openshift-cluster/config.yml
@@ -13,7 +13,7 @@
- include: ../openshift-master/additional_config.yml
-- include: ../openshift-node/config.yml
+- include: ../../openshift-node/private/config.yml
- include: ../openshift-glusterfs/config.yml
when: groups.oo_glusterfs_to_config | default([]) | count > 0
diff --git a/playbooks/common/openshift-cluster/redeploy-certificates/openshift-ca.yml b/playbooks/common/openshift-cluster/redeploy-certificates/openshift-ca.yml
index eb225dfb5..b58bf3c91 100644
--- a/playbooks/common/openshift-cluster/redeploy-certificates/openshift-ca.yml
+++ b/playbooks/common/openshift-cluster/redeploy-certificates/openshift-ca.yml
@@ -272,7 +272,7 @@
state: absent
changed_when: false
-- include: ../../openshift-node/restart.yml
+- include: ../../../openshift-node/private/restart.yml
# Do not restart nodes when node, master or etcd certificates were previously expired.
when:
# nodes
diff --git a/playbooks/common/openshift-master/scaleup.yml b/playbooks/common/openshift-master/scaleup.yml
index cc0196e5b..d070fcf2a 100644
--- a/playbooks/common/openshift-master/scaleup.yml
+++ b/playbooks/common/openshift-master/scaleup.yml
@@ -52,6 +52,6 @@
- include: ../openshift-loadbalancer/config.yml
-- include: ../openshift-node/certificates.yml
+- include: ../../openshift-node/private/certificates.yml
-- include: ../openshift-node/config.yml
+- include: ../../openshift-node/private/config.yml
diff --git a/playbooks/common/openshift-node/additional_config.yml b/playbooks/common/openshift-node/additional_config.yml
deleted file mode 100644
index ac757397b..000000000
--- a/playbooks/common/openshift-node/additional_config.yml
+++ /dev/null
@@ -1,64 +0,0 @@
----
-- name: create additional node network plugin groups
- hosts: "{{ openshift_node_scale_up_group | default('oo_nodes_to_config') }}"
- tasks:
- # Creating these node groups will prevent a ton of skipped tasks.
- # Create group for flannel nodes
- - group_by:
- key: oo_nodes_use_{{ (openshift_use_flannel | default(False)) | ternary('flannel','nothing') }}
- changed_when: False
- # Create group for calico nodes
- - group_by:
- key: oo_nodes_use_{{ (openshift_use_calico | default(False)) | ternary('calico','nothing') }}
- changed_when: False
- # Create group for nuage nodes
- - group_by:
- key: oo_nodes_use_{{ (openshift_use_nuage | default(False)) | ternary('nuage','nothing') }}
- changed_when: False
- # Create group for contiv nodes
- - group_by:
- key: oo_nodes_use_{{ (openshift_use_contiv | default(False)) | ternary('contiv','nothing') }}
- changed_when: False
- # Create group for kuryr nodes
- - group_by:
- key: oo_nodes_use_{{ (openshift_use_kuryr | default(False)) | ternary('kuryr','nothing') }}
- changed_when: False
-
-- include: etcd_client_config.yml
- vars:
- openshift_node_scale_up_group: "oo_nodes_use_flannel:oo_nodes_use_calico:oo_nodes_use_contiv:oo_nodes_use_kuryr"
-
-- name: Additional node config
- hosts: oo_nodes_use_flannel
- roles:
- - role: flannel
- etcd_urls: "{{ hostvars[groups.oo_first_master.0].openshift.master.etcd_urls }}"
- embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"
- when: openshift_use_flannel | default(false) | bool
-
-- name: Additional node config
- hosts: oo_nodes_use_calico
- roles:
- - role: calico
- when: openshift_use_calico | default(false) | bool
-
-- name: Additional node config
- hosts: oo_nodes_use_nuage
- roles:
- - role: nuage_node
- when: openshift_use_nuage | default(false) | bool
-
-- name: Additional node config
- hosts: oo_nodes_use_contiv
- roles:
- - role: contiv
- contiv_role: netplugin
- when: openshift_use_contiv | default(false) | bool
-
-- name: Configure Kuryr node
- hosts: oo_nodes_use_kuryr
- tasks:
- - include_role:
- name: kuryr
- tasks_from: node
- when: openshift_use_kuryr | default(false) | bool
diff --git a/playbooks/common/openshift-node/certificates.yml b/playbooks/common/openshift-node/certificates.yml
deleted file mode 100644
index 908885ee6..000000000
--- a/playbooks/common/openshift-node/certificates.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-- name: Create OpenShift certificates for node hosts
- hosts: oo_nodes_to_config
- gather_facts: no
- roles:
- - role: openshift_node_certificates
- openshift_ca_host: "{{ groups.oo_first_master.0 }}"
- when: not openshift_node_bootstrap | default(false) | bool
diff --git a/playbooks/common/openshift-node/clean_image.yml b/playbooks/common/openshift-node/clean_image.yml
deleted file mode 100644
index 38753d0af..000000000
--- a/playbooks/common/openshift-node/clean_image.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-- name: Configure nodes
- hosts: oo_nodes_to_config:!oo_containerized_master_nodes
- tasks:
- - name: Remove any ansible facts created during AMI creation
- file:
- path: "/etc/ansible/facts.d/{{ item }}"
- state: absent
- with_items:
- - openshift.fact
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
deleted file mode 100644
index 28e3c1b1b..000000000
--- a/playbooks/common/openshift-node/config.yml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-- name: Node Install Checkpoint Start
- hosts: all
- gather_facts: false
- tasks:
- - name: Set Node install 'In Progress'
- run_once: true
- set_stats:
- data:
- installer_phase_node:
- status: "In Progress"
- start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- include: certificates.yml
-
-- include: setup.yml
-
-- include: containerized_nodes.yml
-
-- include: configure_nodes.yml
-
-- include: additional_config.yml
-
-- include: manage_node.yml
-
-- include: enable_excluders.yml
-
-- name: Node Install Checkpoint End
- hosts: all
- gather_facts: false
- tasks:
- - name: Set Node install 'Complete'
- run_once: true
- set_stats:
- data:
- installer_phase_node:
- status: "Complete"
- end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
diff --git a/playbooks/common/openshift-node/configure_nodes.yml b/playbooks/common/openshift-node/configure_nodes.yml
deleted file mode 100644
index 17259422d..000000000
--- a/playbooks/common/openshift-node/configure_nodes.yml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-- name: Configure nodes
- hosts: oo_nodes_to_config:!oo_containerized_master_nodes
- vars:
- openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
- openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}"
- openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}"
- openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
- | union(groups['oo_masters_to_config'])
- | union(groups['oo_etcd_to_config'] | default([])))
- | oo_collect('openshift.common.hostname') | default([]) | join (',')
- }}"
- roles:
- - role: os_firewall
- - role: openshift_node
- - role: tuned
- - role: nickhammond.logrotate
diff --git a/playbooks/common/openshift-node/containerized_nodes.yml b/playbooks/common/openshift-node/containerized_nodes.yml
deleted file mode 100644
index 6fac937e3..000000000
--- a/playbooks/common/openshift-node/containerized_nodes.yml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-- name: Configure containerized nodes
- hosts: oo_containerized_master_nodes
- serial: 1
- vars:
- openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
- openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}"
- openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}"
- openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
- | union(groups['oo_masters_to_config'])
- | union(groups['oo_etcd_to_config'] | default([])))
- | oo_collect('openshift.common.hostname') | default([]) | join (',')
- }}"
-
- roles:
- - role: os_firewall
- - role: openshift_node
- openshift_ca_host: "{{ groups.oo_first_master.0 }}"
- - role: nickhammond.logrotate
diff --git a/playbooks/common/openshift-node/enable_excluders.yml b/playbooks/common/openshift-node/enable_excluders.yml
deleted file mode 100644
index 5288b14f9..000000000
--- a/playbooks/common/openshift-node/enable_excluders.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-- name: Re-enable excluder if it was previously enabled
- hosts: oo_nodes_to_config
- gather_facts: no
- roles:
- - role: openshift_excluder
- r_openshift_excluder_action: enable
- r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
diff --git a/playbooks/common/openshift-node/etcd_client_config.yml b/playbooks/common/openshift-node/etcd_client_config.yml
deleted file mode 100644
index c3fa38a81..000000000
--- a/playbooks/common/openshift-node/etcd_client_config.yml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-- name: etcd_client node config
- hosts: "{{ openshift_node_scale_up_group | default('this_group_does_not_exist') }}"
- roles:
- - role: openshift_facts
- - role: openshift_etcd_facts
- - role: openshift_etcd_client_certificates
- etcd_cert_prefix: flannel.etcd-
- etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}"
- etcd_cert_subdir: "openshift-node-{{ openshift.common.hostname }}"
- etcd_cert_config_dir: "{{ openshift.common.config_base }}/node"
diff --git a/playbooks/common/openshift-node/filter_plugins b/playbooks/common/openshift-node/filter_plugins
deleted file mode 120000
index 99a95e4ca..000000000
--- a/playbooks/common/openshift-node/filter_plugins
+++ /dev/null
@@ -1 +0,0 @@
-../../../filter_plugins \ No newline at end of file
diff --git a/playbooks/common/openshift-node/image_prep.yml b/playbooks/common/openshift-node/image_prep.yml
deleted file mode 100644
index 3c042acdc..000000000
--- a/playbooks/common/openshift-node/image_prep.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-- name: normalize groups
- include: ../../init/evaluate_groups.yml
-
-- name: initialize the facts
- include: ../../init/facts.yml
-
-- name: initialize the repositories
- include: ../../init/repos.yml
-
-- name: run node config setup
- include: setup.yml
-
-- name: run node config
- include: configure_nodes.yml
-
-- name: Re-enable excluders
- include: enable_excluders.yml
-
-- name: Remove any undesired artifacts from build
- include: clean_image.yml
diff --git a/playbooks/common/openshift-node/lookup_plugins b/playbooks/common/openshift-node/lookup_plugins
deleted file mode 120000
index ac79701db..000000000
--- a/playbooks/common/openshift-node/lookup_plugins
+++ /dev/null
@@ -1 +0,0 @@
-../../../lookup_plugins \ No newline at end of file
diff --git a/playbooks/common/openshift-node/manage_node.yml b/playbooks/common/openshift-node/manage_node.yml
deleted file mode 100644
index f48a19a9c..000000000
--- a/playbooks/common/openshift-node/manage_node.yml
+++ /dev/null
@@ -1,12 +0,0 @@
----
-- name: Additional node config
- hosts: "{{ openshift_node_scale_up_group | default('oo_nodes_to_config') }}"
- vars:
- openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
- roles:
- - role: openshift_manage_node
- openshift_master_host: "{{ groups.oo_first_master.0 }}"
- tasks:
- - name: Create group for deployment type
- group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }}
- changed_when: False
diff --git a/playbooks/common/openshift-node/network_manager.yml b/playbooks/common/openshift-node/network_manager.yml
deleted file mode 100644
index c2efb0483..000000000
--- a/playbooks/common/openshift-node/network_manager.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-- include: ../../init/evaluate_groups.yml
-
-- name: Install and configure NetworkManager
- hosts: oo_all_hosts
- become: yes
- tasks:
- - name: install NetworkManager
- package:
- name: 'NetworkManager'
- state: present
-
- - name: configure NetworkManager
- lineinfile:
- dest: "/etc/sysconfig/network-scripts/ifcfg-{{ ansible_default_ipv4['interface'] }}"
- regexp: '^{{ item }}='
- line: '{{ item }}=yes'
- state: present
- create: yes
- with_items:
- - 'USE_PEERDNS'
- - 'NM_CONTROLLED'
-
- - name: enable and start NetworkManager
- service:
- name: 'NetworkManager'
- state: started
- enabled: yes
diff --git a/playbooks/common/openshift-node/restart.yml b/playbooks/common/openshift-node/restart.yml
deleted file mode 100644
index c3beb59b7..000000000
--- a/playbooks/common/openshift-node/restart.yml
+++ /dev/null
@@ -1,61 +0,0 @@
----
-- name: Restart nodes
- hosts: oo_nodes_to_config
- serial: "{{ openshift_restart_nodes_serial | default(1) }}"
-
- roles:
- - lib_openshift
-
- tasks:
- - name: Restart docker
- service:
- name: docker
- state: restarted
- register: l_docker_restart_docker_in_node_result
- until: not l_docker_restart_docker_in_node_result | failed
- retries: 3
- delay: 30
-
- - name: Update docker facts
- openshift_facts:
- role: docker
-
- - name: Restart containerized services
- service:
- name: "{{ item }}"
- state: started
- with_items:
- - etcd_container
- - openvswitch
- - "{{ openshift.common.service_type }}-master-api"
- - "{{ openshift.common.service_type }}-master-controllers"
- - "{{ openshift.common.service_type }}-node"
- failed_when: false
- when: openshift.common.is_containerized | bool
-
- - name: Wait for master API to come back online
- wait_for:
- host: "{{ openshift.common.hostname }}"
- state: started
- delay: 10
- port: "{{ openshift.master.api_port }}"
- timeout: 600
- when: inventory_hostname in groups.oo_masters_to_config
-
- - name: restart node
- service:
- name: "{{ openshift.common.service_type }}-node"
- state: restarted
-
- - name: Wait for node to be ready
- oc_obj:
- state: list
- kind: node
- name: "{{ openshift.common.hostname | lower }}"
- register: node_output
- delegate_to: "{{ groups.oo_first_master.0 }}"
- when: inventory_hostname in groups.oo_nodes_to_config
- until: node_output.results.returncode == 0 and node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
- # Give the node two minutes to come back online.
- retries: 24
- delay: 5
diff --git a/playbooks/common/openshift-node/roles b/playbooks/common/openshift-node/roles
deleted file mode 120000
index e2b799b9d..000000000
--- a/playbooks/common/openshift-node/roles
+++ /dev/null
@@ -1 +0,0 @@
-../../../roles/ \ No newline at end of file
diff --git a/playbooks/common/openshift-node/setup.yml b/playbooks/common/openshift-node/setup.yml
deleted file mode 100644
index 794c03a67..000000000
--- a/playbooks/common/openshift-node/setup.yml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-- name: Disable excluders
- hosts: oo_nodes_to_config
- gather_facts: no
- roles:
- - role: openshift_excluder
- r_openshift_excluder_action: disable
- r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
-
-- name: Evaluate node groups
- hosts: localhost
- become: no
- connection: local
- tasks:
- - name: Evaluate oo_containerized_master_nodes
- add_host:
- name: "{{ item }}"
- groups: oo_containerized_master_nodes
- ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
- ansible_become: "{{ g_sudo | default(omit) }}"
- with_items: "{{ groups.oo_nodes_to_config | default([]) }}"
- when:
- - hostvars[item].openshift is defined
- - hostvars[item].openshift.common is defined
- - hostvars[item].openshift.common.is_containerized | bool
- - (item in groups.oo_nodes_to_config and item in groups.oo_masters_to_config)
- changed_when: False