lint: fixed ansible-lint 301 rule
Change-Id: I8ce7e11cd6027b53f1112c5880a5891c778db9d4
This commit is contained in:
parent
16649df878
commit
8b2e5653e4
@ -7,7 +7,6 @@ quiet: false
|
||||
skip_list:
|
||||
# TODO(ssbarnea): Gradually remove these skips ASAP
|
||||
- 204 # Lines should be no longer than 160 chars
|
||||
- 301 # Commands should not change things if nothing needs doing
|
||||
- 302 # rm used in place of argument state=absent to file module
|
||||
- 303 # sed used in place of template, replace or lineinfile module
|
||||
- 306 # Shells that use pipes should set the pipefail option
|
||||
|
@ -5,3 +5,4 @@
|
||||
{{ ib_repo_workdir }}/install-built-repo.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ ib_repo_install_log }}
|
||||
become: true
|
||||
changed_when: true
|
||||
|
@ -51,6 +51,7 @@
|
||||
LIBGUESTFS_BACKEND_SETTINGS: "{{ lookup( 'env', 'LIBGUESTFS_BACKEND_SETTINGS')|default('force_tcg', true) }}"
|
||||
args:
|
||||
chdir: "{{ modify_image_working_dir }}"
|
||||
changed_when: true
|
||||
|
||||
- name: Extract artifacts from the image
|
||||
shell: >
|
||||
@ -63,3 +64,4 @@
|
||||
args:
|
||||
chdir: "{{ modify_image_working_dir }}"
|
||||
with_items: "{{ modify_image_extract_list }}"
|
||||
changed_when: true
|
||||
|
@ -7,6 +7,7 @@
|
||||
- name: Create a temp dir for extracting images
|
||||
command: mktemp -d
|
||||
register: mktemp_command
|
||||
changed_when: true
|
||||
|
||||
- name: Set names for images and temp dir
|
||||
set_fact:
|
||||
|
@ -26,6 +26,7 @@
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: delete_stack
|
||||
changed_when: true
|
||||
|
||||
- name: Fail if stack was not deleted properly
|
||||
fail:
|
||||
|
@ -11,6 +11,7 @@
|
||||
register: openstack_client_installed
|
||||
tags:
|
||||
- delete
|
||||
changed_when: false
|
||||
|
||||
- name: Fail if no openstack client is installed
|
||||
fail:
|
||||
@ -44,6 +45,7 @@
|
||||
- name: find image
|
||||
shell: openstack image list --long -f value -c ID --public --property latest=centos-7-latest | tail -1
|
||||
register: image_id_latest
|
||||
changed_when: false
|
||||
|
||||
- name: Set fact for image
|
||||
set_fact:
|
||||
@ -63,6 +65,7 @@
|
||||
OS_AUTH_URL: "{{ os_auth_url }}"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
changed_when: true
|
||||
|
||||
- name: Create parent template
|
||||
template:
|
||||
@ -107,6 +110,7 @@
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: create_stack
|
||||
changed_when: true
|
||||
|
||||
- name: Fail if stack failed to create
|
||||
fail:
|
||||
@ -123,6 +127,7 @@
|
||||
command: >
|
||||
openstack stack output show {{ stack_name }} subnode_ip_pairs -c output_value -f value
|
||||
register: subnode_ips
|
||||
changed_when: true
|
||||
|
||||
- name: Add hosts
|
||||
add_host:
|
||||
@ -147,6 +152,7 @@
|
||||
delay: 5
|
||||
with_items:
|
||||
- "{{ groups['subnodes'] }}"
|
||||
changed_when: false
|
||||
|
||||
# In case of blank centos image we need to create CI user and update inventory
|
||||
- when: hostvars['subnode-0'].ansible_user != "{{ nodepool_user }}"
|
||||
|
@ -20,6 +20,7 @@
|
||||
shell: >
|
||||
git config --global user.email "user@example.com";
|
||||
git config --global user.name "CI user"
|
||||
changed_when: true
|
||||
|
||||
- include_tasks: patch_repos.yml
|
||||
with_items: "{{ repos }}"
|
||||
|
@ -10,6 +10,7 @@
|
||||
swapon /root/swapfile;
|
||||
echo "/root/swapfile swap swap defaults 0 0" >> /etc/fstab;
|
||||
become: true
|
||||
changed_when: true
|
||||
|
||||
- name: Create /etc/ci directory
|
||||
file:
|
||||
@ -36,6 +37,7 @@
|
||||
- name: Discover package architecture
|
||||
command: rpm -q --qf "%{arch}" -f /etc/redhat-release
|
||||
register: rpm_arch
|
||||
changed_when: false
|
||||
|
||||
- debug:
|
||||
msg: Package architecture is '{{ rpm_arch.stdout }}'
|
||||
@ -96,6 +98,7 @@
|
||||
with_inventory_hostnames:
|
||||
- subnodes
|
||||
become: true
|
||||
changed_when: true
|
||||
|
||||
- name: start unbound service
|
||||
service:
|
||||
@ -125,6 +128,7 @@
|
||||
shell:
|
||||
iptables-save > /etc/sysconfig/iptables
|
||||
become: true
|
||||
changed_when: true
|
||||
|
||||
- name: Set some env vars
|
||||
lineinfile:
|
||||
|
@ -12,3 +12,4 @@
|
||||
{{ cleanup_stacks_keypairs_log }}
|
||||
args:
|
||||
executable: /bin/bash
|
||||
changed_when: true
|
||||
|
@ -51,6 +51,7 @@
|
||||
nova keypair-add --pub-key {{ existing_key_location }}.pub key-{{ idnum }}
|
||||
ignore_errors: true
|
||||
no_log: true
|
||||
changed_when: true
|
||||
|
||||
- name: copy clouds.yaml file
|
||||
template:
|
||||
@ -65,6 +66,7 @@
|
||||
{{ ovb_dir }}/bin/deploy.py --env {{ local_working_dir }}/env-{{ idnum }}.yaml --name {{ stack_name }} --quintupleo
|
||||
args:
|
||||
chdir: "{{ ovb_dir }}"
|
||||
changed_when: true
|
||||
|
||||
- name: Return stack state
|
||||
shell: >
|
||||
@ -89,6 +91,7 @@
|
||||
openstack stack show "{{ stack_name }}" | grep "status"
|
||||
register: stack_status
|
||||
no_log: true
|
||||
changed_when: false
|
||||
|
||||
- name: Show stack status
|
||||
debug:
|
||||
@ -117,6 +120,7 @@
|
||||
openstack stack show {{ stack_name }} -f json -c outputs
|
||||
register: stack_outputs
|
||||
no_log: true
|
||||
changed_when: false
|
||||
|
||||
- name: Set fact for undercloud floating IP address
|
||||
set_fact:
|
||||
@ -142,6 +146,7 @@
|
||||
until: result is success
|
||||
retries: 300
|
||||
delay: 5
|
||||
changed_when: false
|
||||
|
||||
- when: ovb_setup_user|default('false')|bool
|
||||
block:
|
||||
@ -190,6 +195,7 @@
|
||||
export OS_CLOUD="{{ cloud_name }}";
|
||||
{{ ovb_dir }}/bin/build-nodes-json --env {{ local_working_dir }}/env-{{ idnum }}.yaml --driver {{ baremetal_driver }}
|
||||
register: nodes_json
|
||||
changed_when: true
|
||||
|
||||
- name: remove clouds.yaml file
|
||||
file:
|
||||
|
@ -29,6 +29,7 @@
|
||||
nova keypair-delete key-{{ idnum }}
|
||||
ignore_errors: true
|
||||
no_log: true
|
||||
changed_when: true
|
||||
|
||||
- name: remove clouds.yaml file
|
||||
file:
|
||||
|
@ -19,3 +19,4 @@
|
||||
no_proxy: "{{ lookup('env', 'no_proxy') }}"
|
||||
TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
|
||||
SUBNODES_SSH_KEY: "/etc/nodepool/id_rsa"
|
||||
changed_when: true
|
||||
|
@ -4,3 +4,4 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/overcloud-prep-flavors.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ overcloud_prep_flavors_log }}
|
||||
changed_when: true
|
||||
|
@ -4,3 +4,4 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/overcloud-prep-images.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ overcloud_prep_images_log }}
|
||||
changed_when: true
|
||||
|
@ -4,3 +4,4 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/overcloud-prep-network.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ overcloud_prep_network_log }}
|
||||
changed_when: true
|
||||
|
@ -6,6 +6,7 @@
|
||||
source {{ working_dir }}/stackrc;
|
||||
heat stack-list
|
||||
register: heat_stack_list_result
|
||||
changed_when: false
|
||||
|
||||
- name: Verify the overcloud is in a complete state
|
||||
fail: msg='Overcloud heat stack is not in a complete state'
|
||||
@ -16,12 +17,14 @@
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}'
|
||||
register: node_id_to_delete
|
||||
changed_when: false
|
||||
|
||||
- name: Register the Name of the original {{ node_to_scale }} node
|
||||
shell: >
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}'
|
||||
register: node_name_to_delete
|
||||
changed_when: false
|
||||
|
||||
- name: Display node name to be deleted
|
||||
debug: msg={{ node_name_to_delete.stdout }}
|
||||
@ -38,6 +41,7 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/delete-node.sh 2>&1 {{ timestamper_cmd }} >
|
||||
delete_node_scale_console.log;
|
||||
changed_when: true
|
||||
|
||||
# Verify the delete was successful
|
||||
- name: Poll heat stack-list to determine when node delete is complete
|
||||
@ -48,17 +52,20 @@
|
||||
until: heat_stack_list_result.stdout.find("COMPLETE") != -1
|
||||
retries: 20
|
||||
delay: 90
|
||||
changed_when: false
|
||||
|
||||
- name: Determine the post scale node count
|
||||
shell: >
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
|
||||
register: post_scale_node_count
|
||||
changed_when: false
|
||||
|
||||
- name: Remove deleted hosts from the host file
|
||||
shell: >
|
||||
sed -i '/{{ node_name_to_delete.stdout }}/d' {{ local_working_dir }}/hosts
|
||||
delegate_to: localhost
|
||||
changed_when: true
|
||||
|
||||
- name: Check that post delete node count is correct
|
||||
fail:
|
||||
|
@ -24,24 +24,28 @@
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
|
||||
register: initial_node_count
|
||||
changed_when: false
|
||||
|
||||
- name: Register uuid of original {{ node_to_scale }} node
|
||||
shell: >
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}'
|
||||
register: node_id_to_delete
|
||||
changed_when: false
|
||||
|
||||
- name: Register the Name of the original {{ node_to_scale }} node
|
||||
shell: >
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}'
|
||||
register: node_name_to_delete
|
||||
changed_when: false
|
||||
|
||||
- name: Register pre-scale nova list
|
||||
shell: >
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list
|
||||
register: pre_scale_nova_list
|
||||
changed_when: false
|
||||
|
||||
- name: Display pre-scale nova list
|
||||
debug: msg={{ pre_scale_nova_list.stdout_lines }}
|
||||
|
@ -7,6 +7,7 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/scale-deployment.sh 2>&1 {{ timestamper_cmd }} >
|
||||
overcloud_deployment_scale_console.log;
|
||||
changed_when: true
|
||||
|
||||
- name: Poll heat stack-list to determine when node scale is complete
|
||||
shell: >
|
||||
@ -16,12 +17,14 @@
|
||||
until: heat_stack_list_result.stdout.find("COMPLETE") != -1
|
||||
retries: 20
|
||||
delay: 90
|
||||
changed_when: false
|
||||
|
||||
- name: Register post-scale nova list
|
||||
shell: >
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list
|
||||
register: post_scale_nova_list
|
||||
changed_when: false
|
||||
|
||||
- name: Display post-scale nova list
|
||||
debug:
|
||||
@ -34,6 +37,7 @@
|
||||
source {{ working_dir }}/stackrc;
|
||||
nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
|
||||
register: post_scale_node_count
|
||||
changed_when: false
|
||||
|
||||
- name: Check that post scale node count is correct
|
||||
fail:
|
||||
|
@ -25,6 +25,7 @@
|
||||
do virsh list | grep -E '{{ libvirt_oc_names }}' > /dev/null || break
|
||||
done
|
||||
register: vms_shutdown
|
||||
changed_when: false
|
||||
|
||||
- name: Check that vms are shutdown
|
||||
async_status:
|
||||
@ -40,6 +41,7 @@
|
||||
removes: "{{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak"
|
||||
with_items: "{{ overcloud_nodes }}"
|
||||
when: snapshot_create|bool
|
||||
changed_when: true
|
||||
|
||||
- name: Create snapshot
|
||||
shell: |
|
||||
@ -49,6 +51,7 @@
|
||||
creates: "{{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak"
|
||||
with_items: "{{ overcloud_nodes }}"
|
||||
when: snapshot_create|bool
|
||||
changed_when: true
|
||||
|
||||
- name: Restore previous snapshot
|
||||
shell: |
|
||||
@ -56,6 +59,7 @@
|
||||
qemu-img create -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2
|
||||
with_items: "{{ overcloud_nodes }}"
|
||||
when: snapshot_restore|bool
|
||||
changed_when: true
|
||||
|
||||
- name: Start vms
|
||||
virt:
|
||||
|
@ -18,6 +18,7 @@
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/standalone-container-prep-upgrade.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_container_prep_log }}
|
||||
changed_when: true
|
||||
|
||||
- name: Create the upgrade command for standalone
|
||||
template:
|
||||
@ -29,3 +30,4 @@
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/standalone-upgrade.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_upgrade_log }}
|
||||
changed_when: true
|
||||
|
@ -33,6 +33,7 @@
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/standalone-container-prep.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_container_prep_log }}
|
||||
changed_when: true
|
||||
|
||||
# update the registry to rdo or docker.io
|
||||
- name: update registry if needed in container-prepare-parameters.yaml
|
||||
@ -177,6 +178,7 @@
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/standalone.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_deploy_log }}
|
||||
changed_when: true
|
||||
|
||||
- when: standalone_ansible_lint|default(false)|bool
|
||||
vars:
|
||||
|
@ -15,3 +15,4 @@
|
||||
{{ working_dir }}/{{ script_name }} 2>&1 {{ timestamper_cmd }} >
|
||||
{{ custom_tht_log }}
|
||||
become: true
|
||||
changed_when: true
|
||||
|
@ -10,6 +10,7 @@
|
||||
register: podman_ver
|
||||
tags:
|
||||
- undercloud-install
|
||||
changed_when: false
|
||||
|
||||
|
||||
- name: Set fact for podman version
|
||||
|
@ -29,6 +29,7 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/install_novajoin.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ working_dir }}/install_novajoin.sh.log
|
||||
changed_when: true
|
||||
|
||||
- name: Install novajoin preparation script
|
||||
template:
|
||||
@ -41,10 +42,12 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/novajoin_prep.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ working_dir }}/novajoin_prep.sh.log
|
||||
changed_when: true
|
||||
|
||||
- name: Register OTP output
|
||||
command: cat {{ freeipa_otp_key }}
|
||||
register: ipa_otp_register
|
||||
changed_when: false
|
||||
|
||||
- name: Set OTP Fact for undercloud enrollment
|
||||
set_fact:
|
||||
|
@ -10,3 +10,4 @@
|
||||
set -o pipefail &&
|
||||
{{ local_working_dir }}/validate_minion_simple.sh
|
||||
| tee {{ validate_minion_simple_log }}
|
||||
changed_when: false
|
||||
|
@ -4,3 +4,4 @@
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/validate-sanity-check.sh 2>&1 {{ timestamper_cmd }} >
|
||||
{{ sanity_checks_log }}
|
||||
changed_when: true
|
||||
|
@ -3,6 +3,7 @@
|
||||
shell: >
|
||||
systemctl list-units --failed --plain --no-legend --no-pager "tripleo_*"
|
||||
register: systemd_state
|
||||
changed_when: false
|
||||
|
||||
- name: Print out any failed Systemd services for tripleo_*
|
||||
debug:
|
||||
|
@ -35,3 +35,4 @@
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
{{ working_dir }}/overcloud-validate.sh 2>&1 {{ timestamper_cmd }} > {{ validate_log }}
|
||||
changed_when: true
|
||||
|
@ -5,3 +5,4 @@
|
||||
{{ working_dir }}/tempest-setup.sh 2>&1 {{ timestamper_cmd }} > {{ tempest_log_file }}
|
||||
register: tempest_result
|
||||
ignore_errors: true
|
||||
changed_when: true
|
||||
|
@ -16,6 +16,7 @@
|
||||
- name: Copy stackviz static file to home directory
|
||||
shell: >
|
||||
cp -r "{{ working_dir }}/tempest/.stackviz/share/stackviz-html" "{{ working_dir }}/stackviz"
|
||||
changed_when: true
|
||||
|
||||
- name: Collecting data from tempest
|
||||
shell: |
|
||||
@ -25,6 +26,7 @@
|
||||
register: stackviz_result
|
||||
args:
|
||||
chdir: "{{ working_dir }}/tempest"
|
||||
changed_when: true
|
||||
|
||||
- name: Ensure /var/log/extra exists
|
||||
file:
|
||||
|
@ -41,6 +41,7 @@
|
||||
number_of_files=$(ls {{ tobiko_log_dir }} | grep -E "{{ tobiko_log_file_base }}-[0-9]+.log$" -c);
|
||||
echo $(( $number_of_files + 1 ));
|
||||
register: current_tobiko_log_file_number
|
||||
changed_when: true
|
||||
|
||||
- name: Set tobiko_file_name
|
||||
set_fact:
|
||||
@ -67,3 +68,4 @@
|
||||
- name: Ensure floating IP network exists
|
||||
shell: >
|
||||
bash {{ tobiko_config_dir }}/configure_public_network.sh
|
||||
changed_when: true
|
||||
|
@ -10,3 +10,4 @@
|
||||
ignore_errors: true
|
||||
environment:
|
||||
OS_CLOUD: "{{ tempest_cloud_name }}"
|
||||
changed_when: true
|
||||
|
@ -14,11 +14,13 @@
|
||||
{{ testr_command }} last --subunit > {{ tobiko_log_dir }}/testrepository.subunit
|
||||
args:
|
||||
chdir: "{{ working_dir }}/tobiko"
|
||||
changed_when: true
|
||||
|
||||
- name: Generate HTML results file
|
||||
shell: |
|
||||
set -o pipefail &&
|
||||
subunit2html {{ tobiko_log_dir }}/testrepository.subunit {{ tobiko_log_dir }}/{{ tobiko_log_file }}.html
|
||||
changed_when: true
|
||||
|
||||
- name: Fetch HTML results
|
||||
fetch:
|
||||
|
@ -10,3 +10,4 @@
|
||||
set -o pipefail &&
|
||||
{{ local_working_dir }}/ui_validate_simple.sh
|
||||
| tee {{ ui_validate_simple_log }}
|
||||
changed_when: true
|
||||
|
Loading…
Reference in New Issue
Block a user