Merge "Tag tasks in in common tasks" into stable/rocky
This commit is contained in:
commit
69c6d08dee
|
@ -14,6 +14,12 @@
|
||||||
setype: svirt_sandbox_file_t
|
setype: svirt_sandbox_file_t
|
||||||
selevel: s0
|
selevel: s0
|
||||||
recurse: true
|
recurse: true
|
||||||
|
tags:
|
||||||
|
- host_config
|
||||||
|
- container_config
|
||||||
|
- container_config_tasks
|
||||||
|
- container_config_scripts
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
# Puppet manifest for baremetal host configuration
|
# Puppet manifest for baremetal host configuration
|
||||||
- name: Write the puppet step_config manifest
|
- name: Write the puppet step_config manifest
|
||||||
|
@ -22,6 +28,8 @@
|
||||||
dest: /var/lib/tripleo-config/puppet_step_config.pp
|
dest: /var/lib/tripleo-config/puppet_step_config.pp
|
||||||
force: yes
|
force: yes
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
tags:
|
||||||
|
- host_config
|
||||||
|
|
||||||
# Config file for our docker-puppet.py script, used to generate container configs
|
# Config file for our docker-puppet.py script, used to generate container configs
|
||||||
- name: Create /var/lib/docker-puppet
|
- name: Create /var/lib/docker-puppet
|
||||||
|
@ -30,6 +38,8 @@
|
||||||
state: directory
|
state: directory
|
||||||
setype: svirt_sandbox_file_t
|
setype: svirt_sandbox_file_t
|
||||||
selevel: s0
|
selevel: s0
|
||||||
|
tags:
|
||||||
|
- container_config
|
||||||
|
|
||||||
- name: Write docker-puppet.json file
|
- name: Write docker-puppet.json file
|
||||||
copy:
|
copy:
|
||||||
|
@ -37,11 +47,15 @@
|
||||||
dest: /var/lib/docker-puppet/docker-puppet.json
|
dest: /var/lib/docker-puppet/docker-puppet.json
|
||||||
force: yes
|
force: yes
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
tags:
|
||||||
|
- container_config
|
||||||
|
|
||||||
- name: Create /var/lib/docker-config-scripts
|
- name: Create /var/lib/docker-config-scripts
|
||||||
file:
|
file:
|
||||||
path: /var/lib/docker-config-scripts
|
path: /var/lib/docker-config-scripts
|
||||||
state: directory
|
state: directory
|
||||||
|
tags:
|
||||||
|
- container_config_scripts
|
||||||
|
|
||||||
|
|
||||||
# The container config files
|
# The container config files
|
||||||
|
@ -51,6 +65,8 @@
|
||||||
file:
|
file:
|
||||||
path: /var/lib/docker-container-startup-configs.json
|
path: /var/lib/docker-container-startup-configs.json
|
||||||
state: absent
|
state: absent
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: Write docker config scripts
|
- name: Write docker config scripts
|
||||||
copy:
|
copy:
|
||||||
|
@ -61,6 +77,8 @@
|
||||||
with_dict: "{{ role_data_docker_config_scripts }}"
|
with_dict: "{{ role_data_docker_config_scripts }}"
|
||||||
vars:
|
vars:
|
||||||
role_data_docker_config_scripts: "{{ lookup('file', tripleo_role_name + '/docker_config_scripts.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
role_data_docker_config_scripts: "{{ lookup('file', tripleo_role_name + '/docker_config_scripts.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
||||||
|
tags:
|
||||||
|
- container_config_scripts
|
||||||
|
|
||||||
|
|
||||||
# Here we are dumping all the docker container startup configuration data
|
# Here we are dumping all the docker container startup configuration data
|
||||||
|
@ -73,6 +91,8 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
docker_config_default: "{{ docker_config_default | default({}) | combine( {'step_' + item: {}} ) }}"
|
docker_config_default: "{{ docker_config_default | default({}) | combine( {'step_' + item: {}} ) }}"
|
||||||
with_sequence: count={{ deploy_steps_max }}
|
with_sequence: count={{ deploy_steps_max }}
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: Set docker_startup_configs_with_default fact
|
- name: Set docker_startup_configs_with_default fact
|
||||||
no_log: True
|
no_log: True
|
||||||
|
@ -80,6 +100,8 @@
|
||||||
docker_config_with_default: "{{ docker_config_default | combine(role_data_docker_config) }}"
|
docker_config_with_default: "{{ docker_config_default | combine(role_data_docker_config) }}"
|
||||||
vars:
|
vars:
|
||||||
role_data_docker_config: "{{ lookup('file', tripleo_role_name + '/docker_config.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
role_data_docker_config: "{{ lookup('file', tripleo_role_name + '/docker_config.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: Write docker-container-startup-configs
|
- name: Write docker-container-startup-configs
|
||||||
copy:
|
copy:
|
||||||
|
@ -87,6 +109,8 @@
|
||||||
dest: /var/lib/docker-container-startup-configs.json
|
dest: /var/lib/docker-container-startup-configs.json
|
||||||
force: yes
|
force: yes
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: Write per-step docker-container-startup-configs
|
- name: Write per-step docker-container-startup-configs
|
||||||
copy:
|
copy:
|
||||||
|
@ -95,6 +119,8 @@
|
||||||
force: yes
|
force: yes
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
with_dict: "{{ docker_config_with_default }}"
|
with_dict: "{{ docker_config_with_default }}"
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: Create /var/lib/kolla/config_files directory
|
- name: Create /var/lib/kolla/config_files directory
|
||||||
file:
|
file:
|
||||||
|
@ -103,6 +129,8 @@
|
||||||
setype: svirt_sandbox_file_t
|
setype: svirt_sandbox_file_t
|
||||||
selevel: s0
|
selevel: s0
|
||||||
recurse: true
|
recurse: true
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: Write kolla config json files
|
- name: Write kolla config json files
|
||||||
copy:
|
copy:
|
||||||
|
@ -111,6 +139,8 @@
|
||||||
force: yes
|
force: yes
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
with_dict: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default([], True) | from_yaml }}"
|
with_dict: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default([], True) | from_yaml }}"
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
# Bootstrap tasks, only performed on bootstrap_server_id
|
# Bootstrap tasks, only performed on bootstrap_server_id
|
||||||
|
@ -123,6 +153,8 @@
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- /var/lib/docker-puppet/docker-puppet-tasks*.json
|
- /var/lib/docker-puppet/docker-puppet-tasks*.json
|
||||||
when: deploy_server_id == bootstrap_server_id
|
when: deploy_server_id == bootstrap_server_id
|
||||||
|
tags:
|
||||||
|
- container_config_tasks
|
||||||
|
|
||||||
- name: Write docker-puppet-tasks json files
|
- name: Write docker-puppet-tasks json files
|
||||||
copy:
|
copy:
|
||||||
|
@ -132,6 +164,8 @@
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
with_dict: "{{ lookup('file', tripleo_role_name + '/docker_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
with_dict: "{{ lookup('file', tripleo_role_name + '/docker_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
||||||
when: deploy_server_id == bootstrap_server_id
|
when: deploy_server_id == bootstrap_server_id
|
||||||
|
tags:
|
||||||
|
- container_config_tasks
|
||||||
|
|
||||||
#####################################################
|
#####################################################
|
||||||
# Per step puppet configuration of the baremetal host
|
# Per step puppet configuration of the baremetal host
|
||||||
|
@ -143,6 +177,8 @@
|
||||||
when:
|
when:
|
||||||
- enable_puppet | default(true) | bool
|
- enable_puppet | default(true) | bool
|
||||||
- enable_debug | default(false) | bool
|
- enable_debug | default(false) | bool
|
||||||
|
tags:
|
||||||
|
- host_config
|
||||||
|
|
||||||
- name: Write the config_step hieradata
|
- name: Write the config_step hieradata
|
||||||
copy:
|
copy:
|
||||||
|
@ -150,6 +186,8 @@
|
||||||
dest: /etc/puppet/hieradata/config_step.json
|
dest: /etc/puppet/hieradata/config_step.json
|
||||||
force: true
|
force: true
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
tags:
|
||||||
|
- host_config
|
||||||
|
|
||||||
- name: Run puppet host configuration for step {{ step }}
|
- name: Run puppet host configuration for step {{ step }}
|
||||||
when: enable_puppet|default(true)|bool
|
when: enable_puppet|default(true)|bool
|
||||||
|
@ -165,6 +203,8 @@
|
||||||
register: outputs
|
register: outputs
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
no_log: true
|
||||||
|
tags:
|
||||||
|
- host_config
|
||||||
|
|
||||||
- name: "Debug output for task: Run puppet host configuration for step {{ step }}"
|
- name: "Debug output for task: Run puppet host configuration for step {{ step }}"
|
||||||
debug:
|
debug:
|
||||||
|
@ -173,6 +213,8 @@
|
||||||
- enable_puppet | default(true) | bool
|
- enable_puppet | default(true) | bool
|
||||||
- outputs.rc is defined
|
- outputs.rc is defined
|
||||||
failed_when: outputs.rc not in [0, 2]
|
failed_when: outputs.rc not in [0, 2]
|
||||||
|
tags:
|
||||||
|
- host_config
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
# Generate config via docker-puppet.py
|
# Generate config via docker-puppet.py
|
||||||
|
@ -190,12 +232,16 @@
|
||||||
register: outputs
|
register: outputs
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
no_log: true
|
||||||
|
tags:
|
||||||
|
- container_config
|
||||||
|
|
||||||
- name: "Debug output for task: Run docker-puppet tasks (generate config) during step {{ step }}"
|
- name: "Debug output for task: Run docker-puppet tasks (generate config) during step {{ step }}"
|
||||||
debug:
|
debug:
|
||||||
var: outputs.stdout_lines | default([]) | union(outputs.stderr_lines | default([]))
|
var: outputs.stdout_lines | default([]) | union(outputs.stderr_lines | default([]))
|
||||||
when: outputs.rc is defined
|
when: outputs.rc is defined
|
||||||
failed_when: outputs.rc != 0
|
failed_when: outputs.rc != 0
|
||||||
|
tags:
|
||||||
|
- container_config
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
# Per step starting of the containers using paunch
|
# Per step starting of the containers using paunch
|
||||||
|
@ -214,12 +260,16 @@
|
||||||
register: outputs
|
register: outputs
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
no_log: true
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
- name: "Debug output for task: Start containers for step {{ step }}"
|
- name: "Debug output for task: Start containers for step {{ step }}"
|
||||||
debug:
|
debug:
|
||||||
var: outputs.stdout_lines | default([]) | union(outputs.stderr_lines | default([]))
|
var: outputs.stdout_lines | default([]) | union(outputs.stderr_lines | default([]))
|
||||||
when: outputs.rc is defined
|
when: outputs.rc is defined
|
||||||
failed_when: outputs.rc != 0
|
failed_when: outputs.rc != 0
|
||||||
|
tags:
|
||||||
|
- container_startup_configs
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
# Bootstrap tasks, only performed on bootstrap_server_id
|
# Bootstrap tasks, only performed on bootstrap_server_id
|
||||||
|
@ -229,6 +279,8 @@
|
||||||
stat:
|
stat:
|
||||||
path: /var/lib/docker-puppet/docker-puppet-tasks{{ step }}.json
|
path: /var/lib/docker-puppet/docker-puppet-tasks{{ step }}.json
|
||||||
register: docker_puppet_tasks_json
|
register: docker_puppet_tasks_json
|
||||||
|
tags:
|
||||||
|
- container_config_tasks
|
||||||
|
|
||||||
- name: Run docker-puppet tasks (bootstrap tasks) for step {{ step }}
|
- name: Run docker-puppet tasks (bootstrap tasks) for step {{ step }}
|
||||||
shell: python /var/lib/docker-puppet/docker-puppet.py
|
shell: python /var/lib/docker-puppet/docker-puppet.py
|
||||||
|
@ -245,10 +297,13 @@
|
||||||
register: outputs
|
register: outputs
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
no_log: true
|
||||||
|
tags:
|
||||||
|
- container_config_tasks
|
||||||
|
|
||||||
- name: "Debug output for task: Run docker-puppet tasks (bootstrap tasks) for step {{ step }}"
|
- name: "Debug output for task: Run docker-puppet tasks (bootstrap tasks) for step {{ step }}"
|
||||||
debug:
|
debug:
|
||||||
var: outputs.stdout_lines | default([]) | union(outputs.stderr_lines | default([]))
|
var: outputs.stdout_lines | default([]) | union(outputs.stderr_lines | default([]))
|
||||||
when: outputs.rc is defined
|
when: outputs.rc is defined
|
||||||
failed_when: outputs.rc != 0
|
failed_when: outputs.rc != 0
|
||||||
|
tags:
|
||||||
|
- container_config_tasks
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
other:
|
||||||
|
- |
|
||||||
|
The common tasks in deploy-steps-tasks.yaml that are common to all roles
|
||||||
|
are now tagged with one of: host_config, container_config,
|
||||||
|
container_config_tasks, container_config_scripts, or container_startup_configs.
|
Loading…
Reference in New Issue