Merge "Remove unnecessary block/whitespace from step1 tasks"

This commit is contained in:
Zuul 2020-02-07 01:11:08 +00:00 committed by Gerrit Code Review
commit 7101e5f615
2 changed files with 318 additions and 316 deletions

View File

@ -1,6 +1,4 @@
- name: Write config data at the start of step 1 - name: Create and ensure setype for /var/log/containers directory
block:
- name: Create and ensure setype for /var/log/containers directory
file: file:
path: /var/log/containers path: /var/log/containers
state: directory state: directory
@ -9,14 +7,16 @@
mode: 0750 mode: 0750
tags: tags:
- host_config - host_config
- name: Create ContainerLogStdoutPath directory
- name: Create ContainerLogStdoutPath directory
file: file:
path: "{{ container_log_stdout_path }}" path: "{{ container_log_stdout_path }}"
state: directory state: directory
selevel: s0 selevel: s0
tags: tags:
- host_config - host_config
- name: Create /var/lib/tripleo-config directory
- name: Create /var/lib/tripleo-config directory
file: file:
path: /var/lib/tripleo-config path: /var/lib/tripleo-config
state: directory state: directory
@ -30,7 +30,7 @@
- container_config_scripts - container_config_scripts
- container_startup_configs - container_startup_configs
- name: Delete existing /var/lib/tripleo-config/check-mode directory for check mode - name: Delete existing /var/lib/tripleo-config/check-mode directory for check mode
file: file:
path: /var/lib/tripleo-config/check-mode path: /var/lib/tripleo-config/check-mode
state: absent state: absent
@ -45,7 +45,7 @@
ignore_errors: true ignore_errors: true
check_mode: no check_mode: no
- name: Create /var/lib/tripleo-config/check-mode directory for check mode - name: Create /var/lib/tripleo-config/check-mode directory for check mode
file: file:
path: /var/lib/tripleo-config/check-mode path: /var/lib/tripleo-config/check-mode
state: directory state: directory
@ -62,8 +62,8 @@
- ansible_check_mode|bool - ansible_check_mode|bool
check_mode: no check_mode: no
# 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
no_log: True no_log: True
copy: copy:
content: "{{ lookup('file', tripleo_role_name + '/step_config.pp', errors='ignore') | default('', True) }}" content: "{{ lookup('file', tripleo_role_name + '/step_config.pp', errors='ignore') | default('', True) }}"
@ -75,7 +75,7 @@
check_mode: no check_mode: no
diff: no diff: no
- name: Diff puppet step_config manifest changes for check mode - name: Diff puppet step_config manifest changes for check mode
command: command:
diff -uN /var/lib/tripleo-config/puppet_step_config.pp /var/lib/tripleo-config/check-mode/puppet_step_config.pp diff -uN /var/lib/tripleo-config/puppet_step_config.pp /var/lib/tripleo-config/check-mode/puppet_step_config.pp
register: diff_results register: diff_results
@ -88,7 +88,7 @@
failed_when: false failed_when: false
changed_when: diff_results.rc == 1 changed_when: diff_results.rc == 1
- name: Diff puppet step_config manifest changes for check mode - name: Diff puppet step_config manifest changes for check mode
debug: debug:
var: diff_results.stdout_lines var: diff_results.stdout_lines
changed_when: diff_results.rc == 1 changed_when: diff_results.rc == 1
@ -98,8 +98,8 @@
tags: tags:
- host_config - host_config
# Config file for our container-puppet.py script, used to generate container configs # Config file for our container-puppet.py script, used to generate container configs
- name: Create /var/lib/container-puppet - name: Create /var/lib/container-puppet
file: file:
path: /var/lib/container-puppet path: /var/lib/container-puppet
state: directory state: directory
@ -109,7 +109,7 @@
- container_config - container_config
- container_config_tasks - container_config_tasks
- name: Delete existing /var/lib/container-puppet/check-mode for check mode - name: Delete existing /var/lib/container-puppet/check-mode for check mode
file: file:
path: /var/lib/container-puppet/check-mode path: /var/lib/container-puppet/check-mode
state: absent state: absent
@ -120,7 +120,7 @@
when: when:
- ansible_check_mode|bool - ansible_check_mode|bool
- name: Create /var/lib/container-puppet/check-mode for check mode - name: Create /var/lib/container-puppet/check-mode for check mode
file: file:
path: /var/lib/container-puppet/check-mode path: /var/lib/container-puppet/check-mode
state: directory state: directory
@ -132,7 +132,7 @@
when: when:
- ansible_check_mode|bool - ansible_check_mode|bool
- name: Write container-puppet.json file - name: Write container-puppet.json file
no_log: True no_log: True
copy: copy:
content: "{{ lookup('file', tripleo_role_name + '/puppet_config.yaml', errors='ignore') | default([], True) | from_yaml | to_nice_json }}" content: "{{ lookup('file', tripleo_role_name + '/puppet_config.yaml', errors='ignore') | default([], True) | from_yaml | to_nice_json }}"
@ -144,7 +144,7 @@
check_mode: no check_mode: no
diff: no diff: no
- name: Diff container-puppet.json changes for check mode - name: Diff container-puppet.json changes for check mode
command: command:
diff -uN /var/lib/container-puppet/container-puppet.json /var/lib/container-puppet/check-mode/container-puppet.json diff -uN /var/lib/container-puppet/container-puppet.json /var/lib/container-puppet/check-mode/container-puppet.json
register: diff_results register: diff_results
@ -157,7 +157,7 @@
failed_when: false failed_when: false
changed_when: diff_results.rc == 1 changed_when: diff_results.rc == 1
- name: Diff container-puppet.json changes for check mode - name: Diff container-puppet.json changes for check mode
debug: debug:
var: diff_results.stdout_lines var: diff_results.stdout_lines
changed_when: diff_results.rc == 1 changed_when: diff_results.rc == 1
@ -167,7 +167,7 @@
tags: tags:
- container_config - container_config
- name: Create /var/lib/container-config-scripts - name: Create /var/lib/container-config-scripts
file: file:
path: /var/lib/container-config-scripts path: /var/lib/container-config-scripts
state: directory state: directory
@ -175,18 +175,18 @@
tags: tags:
- container_config_scripts - container_config_scripts
# The container config files # The container config files
# /var/lib/container-startup-configs.json is removed as we now write # /var/lib/container-startup-configs.json is removed as we now write
# per-step files instead # per-step files instead
- name: Clean old /var/lib/container-startup-configs.json file - name: Clean old /var/lib/container-startup-configs.json file
file: file:
path: /var/lib/container-startup-configs.json path: /var/lib/container-startup-configs.json
state: absent state: absent
tags: tags:
- container_startup_configs - container_startup_configs
# For legacy, can be removed in Train cycle # For legacy, can be removed in Train cycle
- name: Clean old /var/lib/docker-container-startup-configs.json file - name: Clean old /var/lib/docker-container-startup-configs.json file
file: file:
path: /var/lib/docker-container-startup-configs.json path: /var/lib/docker-container-startup-configs.json
state: absent state: absent
@ -194,7 +194,7 @@
- container_startup_configs - container_startup_configs
- name: Write container config scripts - name: Write container config scripts
no_log: True no_log: True
copy: copy:
content: "{{ item[1].content }}" content: "{{ item[1].content }}"
@ -210,10 +210,10 @@
tags: tags:
- container_config_scripts - container_config_scripts
# Here we are dumping all the container startup configuration data # Here we are dumping all the container startup configuration data
# so that we can have access to how they are started outside of heat # so that we can have access to how they are started outside of heat
# and container cmd. This lets us create command line tools to test containers. # and container cmd. This lets us create command line tools to test containers.
- name: Set container_config_default fact - name: Set container_config_default fact
no_log: True no_log: True
set_fact: set_fact:
container_config_default: "{{ container_config_default | default({}) | combine( {'step_' + item: {}} ) }}" container_config_default: "{{ container_config_default | default({}) | combine( {'step_' + item: {}} ) }}"
@ -221,7 +221,7 @@
tags: tags:
- container_startup_configs - container_startup_configs
- name: Set container_startup_configs_with_default fact - name: Set container_startup_configs_with_default fact
no_log: True no_log: True
set_fact: set_fact:
container_config_with_default: "{{ container_config_default | combine(role_data_container_config) }}" container_config_with_default: "{{ container_config_default | combine(role_data_container_config) }}"
@ -230,10 +230,10 @@
tags: tags:
- container_startup_configs - container_startup_configs
# This file location is deprecated and the new location is now: # This file location is deprecated and the new location is now:
# /var/lib/tripleo-config/container-startup-config/step_X/<container_name>.json # /var/lib/tripleo-config/container-startup-config/step_X/<container_name>.json
# Can be removed in V cycle # Can be removed in V cycle
- name: Write /var/lib/tripleo-config/container-startup-config-readme.txt - name: Write /var/lib/tripleo-config/container-startup-config-readme.txt
no_log: True no_log: True
copy: copy:
content: "Container startup configs moved to /var/lib/tripleo-config/container-startup-config" content: "Container startup configs moved to /var/lib/tripleo-config/container-startup-config"
@ -243,14 +243,14 @@
tags: tags:
- container_startup_configs - container_startup_configs
- name: Generate startup configs files per step and per container - name: Generate startup configs files per step and per container
no_log: True no_log: True
include_tasks: container_startup_configs_tasks.yaml include_tasks: container_startup_configs_tasks.yaml
loop: "{{ container_config_with_default | dictsort }}" loop: "{{ container_config_with_default | dictsort }}"
tags: tags:
- container_startup_configs - container_startup_configs
- name: Create /var/lib/kolla/config_files directory - name: Create /var/lib/kolla/config_files directory
file: file:
path: /var/lib/kolla/config_files path: /var/lib/kolla/config_files
state: directory state: directory
@ -260,14 +260,14 @@
tags: tags:
- container_startup_configs - container_startup_configs
- name: Create /var/lib/config-data directory - name: Create /var/lib/config-data directory
file: file:
path: /var/lib/config-data path: /var/lib/config-data
state: directory state: directory
setype: svirt_sandbox_file_t setype: svirt_sandbox_file_t
selevel: s0 selevel: s0
- name: Write kolla config json files - name: Write kolla config json files
no_log: True no_log: True
copy: copy:
content: "{{ item[1] | to_nice_json }}" content: "{{ item[1] | to_nice_json }}"
@ -281,14 +281,14 @@
tags: tags:
- container_startup_configs - container_startup_configs
- name: gather facts needed by role - name: gather facts needed by role
setup: setup:
gather_subset: "!min,python" gather_subset: "!min,python"
when: ansible_python is not defined when: ansible_python is not defined
tags: tags:
- container_config_tasks - container_config_tasks
- name: set python_cmd - name: set python_cmd
set_fact: set_fact:
python_cmd: "python{{ ansible_python.version.major }}" python_cmd: "python{{ ansible_python.version.major }}"
cacheable: true cacheable: true
@ -296,7 +296,7 @@
tags: tags:
- container_config_tasks - container_config_tasks
- name: Set host puppet debugging fact string - name: Set host puppet debugging fact string
set_fact: set_fact:
host_puppet_config_debug: "--debug --verbose" host_puppet_config_debug: "--debug --verbose"
when: when:
@ -305,7 +305,7 @@
tags: tags:
- host_config - host_config
- name: Check for /etc/puppet/check-mode directory for check mode - name: Check for /etc/puppet/check-mode directory for check mode
stat: stat:
path: /etc/puppet/check-mode path: /etc/puppet/check-mode
register: check_mode_dir register: check_mode_dir
@ -314,7 +314,7 @@
- host_config - host_config
- container_config - container_config
- name: Create /etc/puppet/check-mode/hieradata directory for check mode - name: Create /etc/puppet/check-mode/hieradata directory for check mode
file: file:
path: /etc/puppet/check-mode/hieradata path: /etc/puppet/check-mode/hieradata
state: directory state: directory
@ -329,7 +329,7 @@
- host_config - host_config
- container_config - container_config
- name: Create puppet check-mode files if they don't exist for check mode - name: Create puppet check-mode files if they don't exist for check mode
shell: | shell: |
cp -a /etc/puppet/hiera.yaml /etc/puppet/check-mode/hiera.yaml cp -a /etc/puppet/hiera.yaml /etc/puppet/check-mode/hiera.yaml
cp -a /etc/puppet/hieradata/* /etc/puppet/check-mode/hieradata/ cp -a /etc/puppet/hieradata/* /etc/puppet/check-mode/hieradata/

View File

@ -834,7 +834,8 @@ outputs:
stat: stat:
path: "/var/lib/tripleo-config/container-startup-config/step_{{step}}" path: "/var/lib/tripleo-config/container-startup-config/step_{{step}}"
register: container_startup_configs_json_stat register: container_startup_configs_json_stat
- include_tasks: common_deploy_steps_tasks_step_1.yaml - name: Write config data at the start of step 1
include_tasks: common_deploy_steps_tasks_step_1.yaml
when: when:
- ((deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or not container_startup_configs_json_stat.stat.exists) - ((deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or not container_startup_configs_json_stat.stat.exists)
tags: tags:
@ -1020,7 +1021,8 @@ outputs:
- import_tasks: deploy_steps_tasks_step_0.yaml - import_tasks: deploy_steps_tasks_step_0.yaml
vars: vars:
step: 0 step: 0
- import_tasks: common_deploy_steps_tasks_step_1.yaml - name: Write config data at the start of step 1
import_tasks: common_deploy_steps_tasks_step_1.yaml
- include_tasks: common_deploy_steps_tasks.yaml - include_tasks: common_deploy_steps_tasks.yaml
with_sequence: start=1 end={{deploy_steps_max-1}} with_sequence: start=1 end={{deploy_steps_max-1}}
loop_control: loop_control: