diff --git a/.ansible-lint b/.ansible-lint index b647e87d3..b2bd100c5 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -2,18 +2,32 @@ exclude_paths: - roles/validate-ui/.travis.yml # we don't want to see failures from sideloaded repos - ../tripleo-upgrade/ -parseable: true +# parseable: true quiet: false skip_list: # TODO(ssbarnea): Gradually remove these skips ASAP - - 204 # Lines should be no longer than 160 chars - - 302 # rm used in place of argument state=absent to file module - - 303 # sed used in place of template, replace or lineinfile module - - 602 # Don't compare to empty string - - 504 # Do not use 'local_action', use 'delegate_to: localhost' - - 701 # No 'galaxy_info' found - - 208 # [E208] File permissions unset or incorrect - - 106 # [E106] Role name {} does not match ^[a-z][a-z0-9_]+$ pattern - - 207 # [E207] Nested jinja pattern - - 306 # [E306] Shells that use pipes should set the pipefail option + - command-instead-of-module # Using command rather than module + - command-instead-of-shell # Use shell only when shell functionality is required + - deprecated-command-syntax # Using command rather than an argument to e.g. file + - deprecated-local-action # Do not use 'local_action', use 'delegate_to: localhost' + - empty-string-compare # Don't compare to empty string + - meta-no-info # meta/main.yml should contain relevant info + - no-changed-when # Commands should not change things if nothing needs doing + - no-jinja-nesting # Nested jinja pattern + - package-latest # Package installs should not use latest + - risky-file-permissions # File permissions unset or incorrect + - risky-shell-pipe # Shells that use pipes should set the pipefail option + - role-name # Role name undercloud-setup does not match ``^[a-z][a-z0-9_]+$`` pattern + - yaml verbosity: 1 +mock_roles: + - collect-logs + - common + - environment/setup + - fetch-images + - libvirt/setup + - repo-setup + - tripleo + - tripleo-collect-logs + - tripleo-inventory + - tripleo-upgrade diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 179c7fb99..ff93759af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # to bump run: pre-commit autoupdate repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v3.4.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -19,14 +19,14 @@ repos: hooks: - id: flake8 - repo: https://github.com/adrienverge/yamllint.git - rev: v1.25.0 + rev: v1.26.0 hooks: - id: yamllint files: \.(yaml|yml)$ types: [file, yaml] entry: yamllint --strict -f parsable - repo: https://github.com/ansible/ansible-lint - rev: v4.3.7 + rev: v5.0.3 hooks: - id: ansible-lint always_run: true diff --git a/.yamllint b/.yamllint index 63a9f13b1..6bcfe4170 100644 --- a/.yamllint +++ b/.yamllint @@ -5,6 +5,9 @@ rules: line-length: max: 180 -#braces: {min-spaces-inside: 1, max-spaces-inside: 10} + # Ansible does not need --- prefix and none of other tools we use do + document-start: disable + # braces: {min-spaces-inside: 1, max-spaces-inside: 10} + ignore: | /roles/standalone/tasks/main.yml diff --git a/playbooks/baremetal-full-freeipa.yml b/playbooks/baremetal-full-freeipa.yml index ef4bff026..20b898019 100644 --- a/playbooks/baremetal-full-freeipa.yml +++ b/playbooks/baremetal-full-freeipa.yml @@ -6,7 +6,8 @@ - freeipa-setup tasks: - - include_role: + - name: Include tripleo-inventory + include_role: name: tripleo-inventory vars: inventory: extra_node @@ -29,7 +30,8 @@ - freeipa-setup tasks: - - include_role: + - name: Include repo-setup + include_role: name: repo-setup vars: repo_setup_dir: /home/{{ supplemental_user|default('centos') }} @@ -43,5 +45,6 @@ become: true changed_when: false - - include_role: + - name: Include freeipa-setup + include_role: name: freeipa-setup diff --git a/playbooks/baremetal-full-overcloud-prep.yml b/playbooks/baremetal-full-overcloud-prep.yml index 98346e11b..af184cc55 100644 --- a/playbooks/baremetal-full-overcloud-prep.yml +++ b/playbooks/baremetal-full-overcloud-prep.yml @@ -39,7 +39,8 @@ vars: validations_group: ['pre-introspection'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) @@ -78,7 +79,8 @@ vars: validations_group: ['pre-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/baremetal-full-overcloud.yml b/playbooks/baremetal-full-overcloud.yml index 50b9f6e2d..5538b0f96 100644 --- a/playbooks/baremetal-full-overcloud.yml +++ b/playbooks/baremetal-full-overcloud.yml @@ -29,7 +29,8 @@ vars: validations_group: ['post-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/baremetal-full-undercloud.yml b/playbooks/baremetal-full-undercloud.yml index f54ad5726..18052aa01 100644 --- a/playbooks/baremetal-full-undercloud.yml +++ b/playbooks/baremetal-full-undercloud.yml @@ -15,7 +15,8 @@ vars: run_tripleo_validations_setup: true tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/baremetal-prep-virthost.yml b/playbooks/baremetal-prep-virthost.yml index 54ef54cd1..17a2fc5d4 100644 --- a/playbooks/baremetal-prep-virthost.yml +++ b/playbooks/baremetal-prep-virthost.yml @@ -45,7 +45,8 @@ hosts: virthost gather_facts: false tasks: - - include_role: + - name: Include baremetal-prep-virthost + include_role: name: baremetal-prep-virthost tasks_from: add_services_ports_firewalld.yml when: @@ -82,7 +83,8 @@ hosts: undercloud gather_facts: false tasks: - - include_role: + - name: Include baremetal-prep-virthost + include_role: name: baremetal-prep-virthost tasks_from: remove_ens3.yml when: @@ -93,7 +95,8 @@ hosts: undercloud gather_facts: false tasks: - - include_role: + - name: Name baremetal-prep-virthost + include_role: name: baremetal-prep-virthost tasks_from: set_locale_UTF_8 when: @@ -141,14 +144,16 @@ cacheable: true when: "'periodic' in zuul.job" - - include_role: + - name: Include build-test-packages + include_role: name: build-test-packages vars: artg_compressed_gating_repo: "/home/{{ undercloud_user }}/gating_repo.tar.gz" artg_repos_dir: "{{ repo_clone_dir|default('/opt/stack/new') }}" when: build_test_packages|default(false)|bool - - include_role: + - name: Include install-built-repo + include_role: name: install-built-repo vars: ib_create_web_repo: "{{ to_build|bool }}" @@ -164,18 +169,21 @@ modify_image_vc_cpu: 4 modify_image_vc_verbose: true tasks: - - include_role: + - name: Include fetch-images + include_role: name: fetch-images when: not to_build|bool - - include_role: + - name: Include repo-setup + include_role: name: repo-setup vars: repo_inject_image_path: "/home/{{ undercloud_user }}/overcloud-full.qcow2" repo_run_live: false when: not to_build|bool - - include_role: + - name: Include repo-setup + include_role: name: repo-setup vars: repo_inject_image_path: "/home/{{ undercloud_user }}/ironic-python-agent.initramfs" @@ -184,13 +192,15 @@ libguestfs_mode: false when: not to_build|bool - - include_role: + - name: Include install-built-repo + include_role: name: install-built-repo vars: ib_repo_image_path: "/home/{{ undercloud_user }}/overcloud-full.qcow2" when: compressed_gating_repo is defined and not to_build|bool - - include_role: + - name: Include install-built-repo + include_role: name: install-built-repo vars: ib_repo_image_path: "/home/{{ undercloud_user }}/ironic-python-agent.initramfs" diff --git a/playbooks/browbeat-minimal.yml b/playbooks/browbeat-minimal.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/browbeat-minimal.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/multinode-multiple-overcloud.yml b/playbooks/multinode-multiple-overcloud.yml index 0fcb07fa4..bd797e3cb 100644 --- a/playbooks/multinode-multiple-overcloud.yml +++ b/playbooks/multinode-multiple-overcloud.yml @@ -77,7 +77,8 @@ vars: validations_group: ['post-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/multinode-overcloud-prep.yml b/playbooks/multinode-overcloud-prep.yml index 82cb7cc79..768f69935 100644 --- a/playbooks/multinode-overcloud-prep.yml +++ b/playbooks/multinode-overcloud-prep.yml @@ -26,7 +26,8 @@ vars: validations_group: ['pre-introspection'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) @@ -50,7 +51,8 @@ vars: validations_group: ['pre-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/multinode-overcloud.yml b/playbooks/multinode-overcloud.yml index ad42a79b6..22cd9bc26 100644 --- a/playbooks/multinode-overcloud.yml +++ b/playbooks/multinode-overcloud.yml @@ -33,7 +33,8 @@ vars: validations_group: ['post-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/multinode-standalone-ipa.yml b/playbooks/multinode-standalone-ipa.yml index e960b6620..654933e74 100644 --- a/playbooks/multinode-standalone-ipa.yml +++ b/playbooks/multinode-standalone-ipa.yml @@ -14,7 +14,8 @@ tags: - standalone tasks: - - include_role: + - name: Include ipa-multinode ipaserver-subnode-install + include_role: name: ipa-multinode tasks_from: ipaserver-subnode-install.yml @@ -23,6 +24,7 @@ tags: - standalone tasks: - - include_role: + - name: Include ipa-multinode ipaserver-undercloud-setup + include_role: name: ipa-multinode tasks_from: ipaserver-undercloud-setup.yml diff --git a/playbooks/multinode-standalone.yml b/playbooks/multinode-standalone.yml index 4099abbf0..36cfa5e92 100644 --- a/playbooks/multinode-standalone.yml +++ b/playbooks/multinode-standalone.yml @@ -54,7 +54,8 @@ tags: - standalone tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - job.enable_validation|default(false)|bool diff --git a/playbooks/multinode-undercloud.yml b/playbooks/multinode-undercloud.yml index 04494c7fe..75a9dfc3f 100644 --- a/playbooks/multinode-undercloud.yml +++ b/playbooks/multinode-undercloud.yml @@ -77,7 +77,8 @@ tags: - tripleo-validations tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - job.enable_validation|default(false)|bool diff --git a/playbooks/overcloud-validate-ha.yml b/playbooks/overcloud-validate-ha.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/overcloud-validate-ha.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/provision.yml b/playbooks/provision.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/provision.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/quickstart-extras-overcloud-prep.yml b/playbooks/quickstart-extras-overcloud-prep.yml index c44d45dbc..703b4608d 100644 --- a/playbooks/quickstart-extras-overcloud-prep.yml +++ b/playbooks/quickstart-extras-overcloud-prep.yml @@ -34,7 +34,8 @@ vars: validations_group: ['pre-introspection'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) @@ -67,7 +68,8 @@ vars: validations_group: ['pre-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/quickstart-extras-overcloud.yml b/playbooks/quickstart-extras-overcloud.yml index 4c70246cd..f57db9feb 100644 --- a/playbooks/quickstart-extras-overcloud.yml +++ b/playbooks/quickstart-extras-overcloud.yml @@ -27,7 +27,8 @@ vars: validations_group: ['post-deployment'] tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/quickstart-extras-standalone.yml b/playbooks/quickstart-extras-standalone.yml index 00b1c91d7..e5180517e 100644 --- a/playbooks/quickstart-extras-standalone.yml +++ b/playbooks/quickstart-extras-standalone.yml @@ -14,7 +14,8 @@ hosts: undercloud gather_facts: true tasks: - - include_role: + - name: Include baremetal-prep-virthost + include_role: name: baremetal-prep-virthost tasks_from: remove_ens3.yml when: diff --git a/playbooks/quickstart-extras-undercloud.yml b/playbooks/quickstart-extras-undercloud.yml index 0460174dd..49b9addb1 100644 --- a/playbooks/quickstart-extras-undercloud.yml +++ b/playbooks/quickstart-extras-undercloud.yml @@ -36,7 +36,8 @@ vars: run_tripleo_validations_setup: true tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - (run_tripleo_validations|bool or run_tripleo_validations_negative_tests|bool) diff --git a/playbooks/quickstart.yml b/playbooks/quickstart.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/quickstart.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/teardown-environment.yml b/playbooks/teardown-environment.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/teardown-environment.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/teardown-nodes.yml b/playbooks/teardown-nodes.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/teardown-nodes.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/teardown-provision.yml b/playbooks/teardown-provision.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/teardown-provision.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/teardown.yml b/playbooks/teardown.yml new file mode 100644 index 000000000..468a17cbb --- /dev/null +++ b/playbooks/teardown.yml @@ -0,0 +1 @@ +- hosts: localhost diff --git a/playbooks/to-build-or-not-to-build.yml b/playbooks/to-build-or-not-to-build.yml index c497eb415..d9e5c86a7 100644 --- a/playbooks/to-build-or-not-to-build.yml +++ b/playbooks/to-build-or-not-to-build.yml @@ -2,5 +2,6 @@ - name: Decide whether we need to build images hosts: undercloud tasks: - - include_role: + - name: Include check-to-build-or-not-to-build + include_role: name: check-to-build-or-not-to-build diff --git a/playbooks/validations.yml b/playbooks/validations.yml index 51b16a40e..2fc965783 100644 --- a/playbooks/validations.yml +++ b/playbooks/validations.yml @@ -6,7 +6,8 @@ - component-validations - tripleo-validations tasks: - - include_role: + - name: Include tripleo_validations + include_role: name: tripleo_validations when: - job.enable_validation|default(false)|bool diff --git a/roles/build-test-packages/tasks/dlrn-build.yml b/roles/build-test-packages/tasks/dlrn-build.yml index b77a9ba91..163c4e2bb 100644 --- a/roles/build-test-packages/tasks/dlrn-build.yml +++ b/roles/build-test-packages/tasks/dlrn-build.yml @@ -71,7 +71,8 @@ failed_when: project_name_mapped.rc != 0 or not project_name_mapped.stdout rescue: - - debug: + - name: Display details in case of failure + debug: msg: | WARNING: Got {{ project_name_mapped.rc }} result code trying to build {{ artg_change.project }} --- STDERR --- diff --git a/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml b/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml index 4adeefdba..a2d779f7d 100644 --- a/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml +++ b/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml @@ -1,5 +1,6 @@ --- -- set_fact: +- name: set subnode_1_ip + set_fact: subnode_1_ip: "{{ hostvars['subnode-1'].inventory_ip }}" - name: set the freeipa_internal_ip @@ -9,7 +10,8 @@ standalone_control_virtual_ip: "{{ undercloud_network_cidr|nthhost(210) }}" cacheable: true -- include_role: +- name: Include repo-setup + include_role: name: repo-setup vars: repo_setup_dir: /home/{{ ansible_user|default('centos') }} @@ -149,7 +151,8 @@ ping -c 5 redhat.com register: ping_output_com -- debug: +- name: Display ping_output_com + debug: msg: "{{ ping_output_com.stdout }}" - name: Add DNS entries @@ -177,8 +180,10 @@ ipa dnsrecord-show ooo.test overcloud register: overcloud_record -- debug: +- name: Display standalone_record + debug: msg: "{{ standalone_record.stdout }}" -- debug: +- name: Display overcloud_record + debug: msg: "{{ overcloud_record.stdout }}" diff --git a/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml b/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml index 1dea835fe..a78384d0c 100644 --- a/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml +++ b/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml @@ -1,5 +1,6 @@ --- -- set_fact: +- name: set facts + set_fact: subnode_1_ip: "{{ hostvars['subnode-1'].inventory_ip }}" standalone_hostname: "standalone-0.{{ tripleo_domain }}" tripleo_domain: ooo.test @@ -154,5 +155,6 @@ register: dig_ouput_com ignore_errors: true -- debug: +- name: Display dig_ouput_com + debug: msg: "dig_ouput_com is {{ dig_ouput_com.stdout }}" diff --git a/roles/nodepool-setup/tasks/main.yml b/roles/nodepool-setup/tasks/main.yml index 979f0b5ee..8312fe098 100644 --- a/roles/nodepool-setup/tasks/main.yml +++ b/roles/nodepool-setup/tasks/main.yml @@ -39,7 +39,8 @@ register: rpm_arch changed_when: false - - debug: + - name: Display rpm_arch result + debug: msg: Package architecture is '{{ rpm_arch.stdout }}' - name: Set contentdir to altarch diff --git a/roles/standalone/tasks/containers.yml b/roles/standalone/tasks/containers.yml index 38ebcc8c5..48eb7ac23 100644 --- a/roles/standalone/tasks/containers.yml +++ b/roles/standalone/tasks/containers.yml @@ -198,7 +198,8 @@ with_sequence: start=0 end="{{ (job.add_repos|length -1)|int }}" register: add_repo_update_list_result - - debug: + - name: Display add_repo_update_list + debug: var: add_repo_update_list - name: Add repos to update_repo @@ -207,7 +208,8 @@ cacheable: true when: add_repo_update_list_result|length > 0 - - debug: + - name: Display add_repos_update + debug: var: add_repos_update - name: Create string from list diff --git a/roles/undercloud-deploy/tasks/create-scripts.yml b/roles/undercloud-deploy/tasks/create-scripts.yml index 21fca2719..9be3d9cc9 100644 --- a/roles/undercloud-deploy/tasks/create-scripts.yml +++ b/roles/undercloud-deploy/tasks/create-scripts.yml @@ -115,7 +115,8 @@ with_sequence: start=0 end="{{ (job.add_repos|length -1)|int }}" register: add_repo_update_list_result - - debug: + - name: Display add_repo_update_list + debug: var: add_repo_update_list - name: Add repos to update_repo @@ -124,7 +125,8 @@ cacheable: true when: add_repo_update_list_result|length > 0 - - debug: + - name: Display add_repos_update + debug: var: add_repos_update - name: Create string from list diff --git a/roles/validate-perf/molecule/default/converge.yml b/roles/validate-perf/molecule/default/converge.yml index 3c0db02c8..596b52cd4 100644 --- a/roles/validate-perf/molecule/default/converge.yml +++ b/roles/validate-perf/molecule/default/converge.yml @@ -3,6 +3,7 @@ hosts: all gather_facts: false tasks: - - include_role: + - name: Include validate-perf security_disable + include_role: name: validate-perf tasks_from: security_disable diff --git a/roles/validate-perf/tasks/main.yml b/roles/validate-perf/tasks/main.yml index aafabe325..571a1e6dd 100644 --- a/roles/validate-perf/tasks/main.yml +++ b/roles/validate-perf/tasks/main.yml @@ -27,5 +27,6 @@ poll: 0 changed_when: false rescue: - - debug: + - name: Display warning about performance + debug: msg: "Warning: Performance cannot be validated." diff --git a/roles/virthost-full-cleanup/tasks/main.yml b/roles/virthost-full-cleanup/tasks/main.yml index c1e3ab0f9..a3e9235e8 100644 --- a/roles/virthost-full-cleanup/tasks/main.yml +++ b/roles/virthost-full-cleanup/tasks/main.yml @@ -8,7 +8,8 @@ - name: unregister rhn via subscription manager redhat_subscription: state=absent - - debug: msg="All errors in this block are ignored" + - name: Display message about ignoring errors + debug: msg="All errors in this block are ignored" - name: ensure libvirt-python is installed yum: name=libvirt-python state=present