Skip to content

Commit 4744d9c

Browse files
Hack hack hack
1 parent e28d111 commit 4744d9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1834
-300
lines changed

playbooks/common/openshift-cluster/upgrades/docker/tasks/restart.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66
retries: 3
77
delay: 30
88

9+
- name: Restart static master services
10+
command: /usr/bin/master-restart "{{ item }}"
11+
with_items:
12+
- api
13+
- controllers
14+
- etcd
15+
failed_when: false
16+
when: openshift_is_containerized | bool
17+
918
- name: Restart containerized services
1019
service: name={{ item }} state=started
1120
with_items:
12-
- etcd_container
1321
- openvswitch
14-
- "{{ openshift_service_type }}-master-api"
15-
- "{{ openshift_service_type }}-master-controllers"
1622
- "{{ openshift_service_type }}-node"
1723
failed_when: false
1824
when: openshift_is_containerized | bool

playbooks/common/openshift-cluster/upgrades/docker/tasks/upgrade.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
- name: Stop containerized services
55
service: name={{ item }} state=stopped
66
with_items:
7-
- "{{ openshift_service_type }}-master-api"
8-
- "{{ openshift_service_type }}-master-controllers"
97
- "{{ openshift_service_type }}-node"
10-
- etcd_container
118
- openvswitch
129
failed_when: false
1310
when: openshift_is_containerized | bool
1411

12+
- name: Restart static master services
13+
command: /usr/bin/master-restart "{{ item }}"
14+
with_items:
15+
- api
16+
- controllers
17+
- etcd
18+
failed_when: false
19+
1520
- name: Check Docker image count
1621
shell: "docker images -aq | wc -l"
1722
register: docker_image_count

playbooks/gcp/openshift-cluster/build_base_image.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
- wget
130130
- git
131131
- net-tools
132-
- bind-utils
133132
- iptables-services
134133
- bridge-utils
135134
- bash-completion

playbooks/openshift-master/private/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,22 @@
176176
openshift_no_proxy_etcd_host_ips: "{{ hostvars | lib_utils_oo_select_keys(groups['oo_etcd_to_config'] | default([]))
177177
| lib_utils_oo_collect('openshift.common.ip') | default([]) | join(',')
178178
}}"
179+
pre_tasks:
180+
- name: Prepare the bootstrap node config on masters for self-hosting
181+
import_role:
182+
name: openshift_node_group
183+
tasks_from: bootstrap
184+
when: openshift_master_bootstrap_enabled | default(false) | bool
185+
179186
roles:
180187
- role: openshift_master_facts
181188
- role: openshift_clock
182189
- role: openshift_cloud_provider
183190
- role: openshift_builddefaults
184191
- role: openshift_buildoverrides
185192
- role: nickhammond.logrotate
193+
194+
# DEPRECATED: begin moving away from this
186195
- role: openshift_master
187196
openshift_master_ha: "{{ (groups.oo_masters | length > 1) | bool }}"
188197
openshift_master_hosts: "{{ groups.oo_masters_to_config }}"
@@ -192,6 +201,17 @@
192201
openshift_master_default_registry_value: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value }}"
193202
openshift_master_default_registry_value_api: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value_api }}"
194203
openshift_master_default_registry_value_controllers: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value_controllers }}"
204+
when: not ( openshift_master_bootstrap_enabled | default(false) | bool )
205+
206+
- role: openshift_control_plane
207+
openshift_master_hosts: "{{ groups.oo_masters_to_config }}"
208+
r_openshift_master_clean_install: "{{ hostvars[groups.oo_first_master.0].l_clean_install }}"
209+
r_openshift_master_etcd3_storage: "{{ hostvars[groups.oo_first_master.0].l_etcd3_enabled }}"
210+
openshift_master_is_scaleup_host: "{{ g_openshift_master_is_scaleup | default(false) }}"
211+
openshift_master_default_registry_value: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value }}"
212+
openshift_master_default_registry_value_api: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value_api }}"
213+
openshift_master_default_registry_value_controllers: "{{ hostvars[groups.oo_first_master.0].l_default_registry_value_controllers }}"
214+
when: openshift_master_bootstrap_enabled | default(false) | bool
195215
- role: tuned
196216
- role: nuage_ca
197217
when: openshift_use_nuage | default(false) | bool

playbooks/openshift-master/private/scaleup.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,14 @@
1515
yaml_key: 'kubernetesMasterConfig.masterCount'
1616
yaml_value: "{{ openshift.master.master_count }}"
1717
notify:
18-
- restart master api
19-
- restart master controllers
18+
- restart master
2019
handlers:
21-
- name: restart master api
22-
service: name={{ openshift_service_type }}-master-controllers state=restarted
20+
- name: restart master
21+
command: /usr/bin/master-restart "{{ item }}"
22+
with_items:
23+
- api
24+
- controllers
2325
notify: verify api server
24-
# We retry the controllers because the API may not be 100% initialized yet.
25-
- name: restart master controllers
26-
command: "systemctl restart {{ openshift_service_type }}-master-controllers"
27-
retries: 3
28-
delay: 5
29-
register: result
30-
until: result.rc == 0
3126
- name: verify api server
3227
command: >
3328
curl --silent --tlsv1.2

playbooks/openshift-master/private/tasks/wire_aggregator.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,11 @@
191191
#restart master serially here
192192
- when: yedit_output.changed or (yedit_asset_config_output is defined and yedit_asset_config_output.changed)
193193
block:
194-
- name: restart master api
195-
systemd: name={{ openshift_service_type }}-master-api state=restarted
196-
197-
# We retry the controllers because the API may not be 100% initialized yet.
198-
- name: restart master controllers
199-
command: "systemctl restart {{ openshift_service_type }}-master-controllers"
200-
retries: 3
201-
delay: 5
202-
register: result
203-
until: result.rc == 0
194+
- name: restart master
195+
command: /usr/bin/master-restart "{{ item }}"
196+
with_items:
197+
- api
198+
- controllers
204199

205200
- name: Verify API Server
206201
# Using curl here since the uri module requires python-httplib2 and

playbooks/openshift-node/private/image_prep.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
- import_role:
1919
name: openshift_node
2020
tasks_from: bootstrap.yml
21+
- import_role:
22+
name: openshift_node_group
23+
tasks_from: bootstrap.yml
24+
2125

2226
- name: Re-enable excluders
2327
import_playbook: enable_excluders.yml

playbooks/openshift-node/private/restart.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
name: "{{ item }}"
2424
state: started
2525
with_items:
26-
- etcd_container
2726
- openvswitch
28-
- "{{ openshift_service_type }}-master-api"
29-
- "{{ openshift_service_type }}-master-controllers"
3027
- "{{ openshift_service_type }}-node"
3128
failed_when: false
3229
when: openshift_is_containerized | bool
File renamed without changes.

roles/etcd/tasks/main.yml

Lines changed: 4 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -9,104 +9,12 @@
99
- name: setup firewall
1010
import_tasks: firewall.yml
1111

12-
- name: Install etcd
13-
package: name=etcd{{ '-' + etcd_version if etcd_version is defined else '' }} state=present
14-
when: not etcd_is_containerized | bool
15-
register: result
16-
until: result is succeeded
17-
18-
- include_tasks: drop_etcdctl.yml
19-
when:
20-
- openshift_etcd_etcdctl_profile | default(true) | bool
21-
22-
- block:
23-
- name: Pull etcd container
24-
command: docker pull {{ etcd_image }}
25-
register: pull_result
26-
changed_when: "'Downloaded newer image' in pull_result.stdout"
27-
28-
- name: Install etcd container service file
29-
template:
30-
dest: "/etc/systemd/system/etcd_container.service"
31-
src: etcd.docker.service
32-
when:
33-
- etcd_is_containerized | bool
34-
- not l_is_etcd_system_container | bool
35-
36-
# Start secondary etcd instance for third party integrations
37-
# TODO: Determine an alternative to using thirdparty variable
38-
- block:
39-
- name: Create configuration directory
40-
file:
41-
path: "{{ etcd_conf_dir }}"
42-
state: directory
43-
mode: 0700
44-
45-
# TODO: retest with symlink to confirm it does or does not function
46-
- name: Copy service file for etcd instance
47-
copy:
48-
src: /usr/lib/systemd/system/etcd.service
49-
dest: "/etc/systemd/system/{{ etcd_service }}.service"
50-
remote_src: True
51-
52-
- name: Create third party etcd service.d directory exists
53-
file:
54-
path: "{{ etcd_systemd_dir }}"
55-
state: directory
56-
57-
- name: Configure third part etcd service unit file
58-
template:
59-
dest: "{{ etcd_systemd_dir }}/custom.conf"
60-
src: custom.conf.j2
61-
when: etcd_is_thirdparty
62-
6312
# TODO: this task may not be needed with Validate permissions
6413
- name: Ensure etcd datadir exists
6514
file:
6615
path: "{{ etcd_data_dir }}"
6716
state: directory
6817
mode: 0700
69-
when: etcd_is_containerized | bool
70-
71-
- name: Ensure etcd datadir ownership for thirdparty datadir
72-
file:
73-
path: "{{ etcd_data_dir }}"
74-
state: directory
75-
mode: 0700
76-
owner: etcd
77-
group: etcd
78-
recurse: True
79-
when: etcd_is_thirdparty | bool
80-
81-
# TODO: Determine if the below reload would work here, for now just reload
82-
- name:
83-
command: systemctl daemon-reload
84-
when: etcd_is_thirdparty | bool
85-
86-
- block:
87-
- name: Disable system etcd when containerized
88-
systemd:
89-
name: etcd
90-
state: stopped
91-
enabled: no
92-
masked: yes
93-
daemon_reload: yes
94-
when: not l_is_etcd_system_container | bool
95-
register: task_result
96-
failed_when:
97-
- task_result is failed
98-
- ('could not' not in task_result.msg|lower)
99-
100-
- name: Install etcd container service file
101-
template:
102-
dest: "/etc/systemd/system/etcd_container.service"
103-
src: etcd.docker.service
104-
when: not l_is_etcd_system_container | bool
105-
106-
- name: Install Etcd system container
107-
include_tasks: system_container.yml
108-
when: l_is_etcd_system_container | bool
109-
when: etcd_is_containerized | bool
11018

11119
- name: Validate permissions on the config dir
11220
file:
@@ -121,16 +29,9 @@
12129
src: etcd.conf.j2
12230
dest: "{{ etcd_conf_file }}"
12331
backup: true
124-
notify:
125-
- restart etcd
12632

12733
- name: Enable etcd
128-
systemd:
129-
name: "{{ etcd_service }}"
130-
state: started
131-
enabled: yes
132-
register: start_result
133-
134-
- name: Set fact etcd_service_status_changed
135-
set_fact:
136-
etcd_service_status_changed: "{{ start_result is changed }}"
34+
copy:
35+
src: "etcd.yaml"
36+
dest: "/etc/origin/node/pods/"
37+
mode: 0700
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
OpenShift Control Plane
2+
==================================
3+
4+
Installs the services that comprise the OpenShift control plane onto nodes that are preconfigured for
5+
bootstrapping.
6+
7+
Requirements
8+
------------
9+
10+
* Ansible 2.2
11+
* A RHEL 7.1 host pre-configured with access to the rhel-7-server-rpms,
12+
rhel-7-server-extras-rpms, and rhel-7-server-ose-3.0-rpms repos.
13+
14+
Role Variables
15+
--------------
16+
17+
From this role:
18+
19+
| Name | Default value | |
20+
|---------------------------------------------------|-----------------------|-------------------------------------------------------------------------------|
21+
| openshift_node_ips | [] | List of the openshift node ip addresses to pre-register when master starts up |
22+
| oreg_url | UNDEF | Default docker registry to use |
23+
| oreg_url_master | UNDEF | Default docker registry to use, specifically on the master |
24+
| openshift_master_api_port | UNDEF | |
25+
| openshift_master_console_port | UNDEF | |
26+
| openshift_master_api_url | UNDEF | |
27+
| openshift_master_console_url | UNDEF | |
28+
| openshift_master_public_api_url | UNDEF | |
29+
| openshift_master_public_console_url | UNDEF | |
30+
| openshift_master_saconfig_limit_secret_references | false | |
31+
32+
33+
Dependencies
34+
------------
35+
36+
37+
Example Playbook
38+
----------------
39+
40+
TODO
41+
42+
License
43+
-------
44+
45+
Apache License, Version 2.0
46+
47+
Author Information
48+
------------------
49+
50+
TODO

0 commit comments

Comments
 (0)