Skip to content

Commit 6640950

Browse files
authored
Merge pull request #169 from stackhpc/stable/wallaby
Sync stable/wallaby
2 parents b6d8eef + 829974b commit 6640950

File tree

160 files changed

+1044
-793
lines changed

Some content is hidden

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

160 files changed

+1044
-793
lines changed

ansible/gather-facts.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
- name: Gather facts for all hosts
66
hosts: all
77
serial: '{{ kolla_serial|default("0") }}'
8-
gather_facts: true
8+
gather_facts: false
99
tasks:
10+
- name: Gather facts
11+
setup:
12+
filter: "{{ kolla_ansible_setup_filter }}"
13+
gather_subset: "{{ kolla_ansible_setup_gather_subset }}"
14+
when:
15+
- not ansible_facts
16+
1017
- name: Group hosts to determine when using --limit
1118
group_by:
1219
key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
@@ -32,10 +39,12 @@
3239
tasks:
3340
- name: Gather facts
3441
setup:
42+
filter: "{{ kolla_ansible_setup_filter }}"
43+
gather_subset: "{{ kolla_ansible_setup_gather_subset }}"
3544
delegate_facts: True
3645
delegate_to: "{{ item }}"
3746
with_items: "{{ delegate_hosts }}"
3847
# We gathered facts for all hosts in the batch during the first play.
3948
when:
40-
- not hostvars[item].ansible_facts.module_setup | default(false)
49+
- not hostvars[item].ansible_facts
4150
tags: always

ansible/group_vars/all.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ node_config_directory: "/etc/kolla"
2020
config_owner_user: "root"
2121
config_owner_group: "root"
2222

23+
###################
24+
# Ansible options
25+
###################
26+
27+
# This variable is used as the "filter" argument for the setup module. For
28+
# instance, if one wants to remove/ignore all Neutron interface facts:
29+
# kolla_ansible_setup_filter: "ansible_[!qt]*"
30+
# By default, we do not provide a filter.
31+
kolla_ansible_setup_filter: "{{ omit }}"
32+
33+
# This variable is used as the "gather_subset" argument for the setup module.
34+
# For instance, if one wants to avoid collecting facts via facter:
35+
# kolla_ansible_setup_gather_subset: "all,!facter"
36+
# By default, we do not provide a gather subset.
37+
kolla_ansible_setup_gather_subset: "{{ omit }}"
2338

2439
###################
2540
# Kolla options
@@ -704,6 +719,7 @@ nova_keystone_user: "nova"
704719
placement_keystone_user: "placement"
705720
murano_keystone_user: "murano"
706721
cinder_keystone_user: "cinder"
722+
glance_keystone_user: "glance"
707723

708724
# Nova fake driver and the number of fake driver per compute node
709725
enable_nova_fake: "no"
@@ -1048,7 +1064,7 @@ ceph_cinder_user: "cinder"
10481064
ceph_glance_user: "glance"
10491065
ceph_gnocchi_user: "gnocchi"
10501066
ceph_manila_user: "manila"
1051-
ceph_nova_user: "nova"
1067+
ceph_nova_user: "{{ ceph_cinder_user }}"
10521068

10531069
# External Ceph keyrings
10541070
ceph_cinder_keyring: "ceph.client.cinder.keyring"

ansible/library/kolla_docker.py

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@
264264
'''
265265

266266

267+
COMPARE_CONFIG_CMD = ['/usr/local/bin/kolla_set_configs', '--check']
268+
269+
267270
def get_docker_client():
268271
return docker.APIClient
269272

@@ -348,7 +351,9 @@ def get_container_info(self):
348351

349352
def compare_container(self):
350353
container = self.check_container()
351-
if not container or self.check_container_differs():
354+
if (not container or
355+
self.check_container_differs() or
356+
self.compare_config()):
352357
self.changed = True
353358
return self.changed
354359

@@ -614,6 +619,43 @@ def compare_healthcheck(self, container_info):
614619
if current_healthcheck:
615620
return True
616621

622+
def compare_config(self):
623+
try:
624+
job = self.dc.exec_create(
625+
self.params['name'],
626+
COMPARE_CONFIG_CMD,
627+
user='root',
628+
)
629+
output = self.dc.exec_start(job)
630+
exec_inspect = self.dc.exec_inspect(job)
631+
except docker.errors.APIError as e:
632+
# NOTE(yoctozepto): If we have a client error, then the container
633+
# cannot be used for config check (e.g., is restarting, or stopped
634+
# in the mean time) - assume config is stale = return True.
635+
# Else, propagate the server error back.
636+
if e.is_client_error():
637+
return True
638+
else:
639+
raise
640+
# Exit codes:
641+
# 0: not changed
642+
# 1: changed
643+
# 137: abrupt exit -> changed
644+
# else: error
645+
if exec_inspect['ExitCode'] == 0:
646+
return False
647+
elif exec_inspect['ExitCode'] == 1:
648+
return True
649+
elif exec_inspect['ExitCode'] == 137:
650+
# NOTE(yoctozepto): This is Docker's command exit due to container
651+
# exit. It means the container is unstable so we are better off
652+
# marking it as requiring a restart due to config update.
653+
return True
654+
else:
655+
raise Exception('Failed to compare container configuration: '
656+
'ExitCode: %s Message: %s' %
657+
(exec_inspect['ExitCode'], output))
658+
617659
def parse_image(self):
618660
full_image = self.params.get('image')
619661

ansible/roles/aodh/tasks/pull.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
---
2-
- name: Pulling aodh images
3-
become: true
4-
kolla_docker:
5-
action: "pull_image"
6-
common_options: "{{ docker_common_options }}"
7-
image: "{{ item.value.image }}"
8-
when:
9-
- inventory_hostname in groups[item.value.group]
10-
- item.value.enabled | bool
11-
with_dict: "{{ aodh_services }}"
2+
- import_role:
3+
role: service-images-pull
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
---
2-
- name: Pulling barbican images
3-
become: true
4-
kolla_docker:
5-
action: "pull_image"
6-
common_options: "{{ docker_common_options }}"
7-
image: "{{ item.value.image }}"
8-
when:
9-
- inventory_hostname in groups[item.value.group]
10-
- item.value.enabled | bool
11-
with_dict: "{{ barbican_services }}"
2+
- import_role:
3+
role: service-images-pull

ansible/roles/baremetal/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ change_selinux: True
3232

3333
selinux_state: "permissive"
3434

35+
# If true, the host firewall service (firewalld or ufw) will be disabled.
36+
disable_firewall: True
37+
3538
docker_storage_driver: ""
3639
docker_custom_option: ""
3740
docker_custom_config: {}

ansible/roles/baremetal/tasks/install.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,36 @@
66
when: ansible_facts.os_family == 'Debian'
77

88
# TODO(inc0): Gates don't seem to have ufw executable, check for it instead of ignore errors
9-
- name: Set firewall default policy
10-
become: True
11-
ufw:
12-
state: disabled
13-
policy: allow
14-
when: ansible_facts.os_family == 'Debian'
15-
ignore_errors: yes
16-
17-
- name: Check if firewalld is installed
18-
command: rpm -q firewalld
19-
register: firewalld_check
20-
changed_when: false
21-
failed_when: firewalld_check.rc > 1
22-
args:
23-
warn: false
24-
when: ansible_facts.os_family == 'RedHat'
9+
- block:
10+
- name: Set firewall default policy
11+
become: True
12+
ufw:
13+
state: disabled
14+
policy: allow
15+
when: ansible_facts.os_family == 'Debian'
16+
ignore_errors: yes
17+
18+
- name: Check if firewalld is installed
19+
command: rpm -q firewalld
20+
register: firewalld_check
21+
changed_when: false
22+
failed_when: firewalld_check.rc > 1
23+
args:
24+
warn: false
25+
when: ansible_facts.os_family == 'RedHat'
2526

26-
- name: Disable firewalld
27-
become: True
28-
service:
29-
name: "{{ item }}"
30-
enabled: false
31-
state: stopped
32-
with_items:
33-
- firewalld
34-
when:
35-
- ansible_facts.os_family == 'RedHat'
36-
- firewalld_check.rc == 0
27+
- name: Disable firewalld
28+
become: True
29+
service:
30+
name: "{{ item }}"
31+
enabled: false
32+
state: stopped
33+
with_items:
34+
- firewalld
35+
when:
36+
- ansible_facts.os_family == 'RedHat'
37+
- firewalld_check.rc == 0
38+
when: disable_firewall | bool
3739

3840
# Upgrading docker engine may cause containers to stop. Take a snapshot of the
3941
# running containers prior to a potential upgrade of Docker.

ansible/roles/baremetal/tasks/pre-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
- name: Install docker rpm gpg key
145145
rpm_key:
146146
state: present
147-
key: "{{ docker_yum_url }}/gpg"
147+
key: "{{ docker_yum_gpgkey }}"
148148
become: True
149149
when: docker_yum_gpgcheck | bool
150150
when: ansible_facts.os_family == 'RedHat'
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
---
2-
- name: Pulling blazar images
3-
become: true
4-
kolla_docker:
5-
action: "pull_image"
6-
common_options: "{{ docker_common_options }}"
7-
image: "{{ item.value.image }}"
8-
when:
9-
- inventory_hostname in groups[item.value.group]
10-
- item.value.enabled | bool
11-
with_dict: "{{ blazar_services }}"
2+
- import_role:
3+
role: service-images-pull

ansible/roles/blazar/templates/blazar.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ log_dir = /var/log/kolla/blazar
44
transport_url = {{ rpc_transport_url }}
55
host = {{ api_interface_address }}
66
port = {{ blazar_api_port }}
7-
os_auth_host = {{ kolla_internal_fqdn }}
7+
os_auth_host = {{ keystone_internal_fqdn }}
88
os_auth_port = {{ keystone_admin_port }}
99
os_auth_protocol = {{ admin_protocol }}
1010
os_auth_version = v3

0 commit comments

Comments
 (0)