From 4382257d3f4328830786a97feea0c452aefa7f43 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 14 Jul 2023 20:07:26 +0200 Subject: [PATCH] Fix linters and metadata With update of ansible-lint to version >=6.0.0 a lot of new linters were added, that enabled by default. In order to comply with linter rules we're applying changes to the role. With that we also update metdata to reflect current state. Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223 Change-Id: I9aaf6680c274453a16b6f9879cf488ae2050e71f --- defaults/main.yml | 27 ++++++++++++++++++--------- meta/main.yml | 25 +++++++++++++------------ tasks/main.yml | 26 ++++++++++++++++---------- tasks/tacker_messaging_setup.yml | 1 - tasks/tacker_post_install.yml | 1 + tasks/tacker_pre_install.yml | 2 +- vars/main.yml | 3 ++- 7 files changed, 51 insertions(+), 34 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 95f35c6..32c83a2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -19,7 +19,7 @@ ## Verbosity Options debug: False -#python venv executable +# python venv executable tacker_venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}" # Enable/Disable Ceilometer @@ -29,7 +29,11 @@ tacker_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups # for the service setup. The host must already have # clouds.yaml properly configured. tacker_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" -tacker_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((tacker_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" +tacker_service_setup_host_python_interpreter: >- + {{ + openstack_service_setup_host_python_interpreter | default( + (tacker_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) + }} # Set the package install state for distribution packages # Options are 'present' and 'latest' @@ -37,7 +41,8 @@ tacker_package_state: "{{ package_state | default('latest') }}" tacker_git_repo: https://opendev.org/openstack/tacker tacker_git_install_branch: master -tacker_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" +tacker_upper_constraints_url: >- + {{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }} tacker_git_constraints: - "--constraint {{ tacker_upper_constraints_url }}" @@ -96,7 +101,11 @@ tacker_optional_oslomsg_amqp1_pip_packages: ## Database info tacker_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" -tacker_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((tacker_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" +tacker_db_setup_python_interpreter: >- + {{ + openstack_db_setup_python_interpreter | default( + (tacker_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) + }} tacker_galera_address: "{{ galera_address | default('127.0.0.1') }}" tacker_galera_database: tacker tacker_galera_user: tacker @@ -136,20 +145,20 @@ tacker_services: service_name: "{{ tacker_service_name }}" enabled: yes state: started - execstarts: "{{ tacker_bin }}/{{ tacker_program_name }} {{ tacker_config_options|default('') }}" + execstarts: "{{ tacker_bin }}/{{ tacker_program_name }} {{ tacker_config_options | default('') }}" config_overrides: "{{ tacker_init_config_overrides }}" tacker-conductor: group: tacker_server service_name: "{{ tacker_conductor_program_name }}" enabled: yes state: started - execstarts: "{{ tacker_bin }}/{{ tacker_conductor_program_name }} {{ tacker_conductor_config_options|default('') }}" + execstarts: "{{ tacker_bin }}/{{ tacker_conductor_program_name }} {{ tacker_conductor_config_options | default('') }}" config_overrides: "{{ tacker_conductor_init_config_overrides }}" ## Barbican service barbican_keys_backend: false -#NOTE: move password to tests/test-vars.yml +# NOTE: move password to tests/test-vars.yml tacker_service_password: password ## Keystone @@ -240,5 +249,5 @@ tacker_pki_install_certificates: mode: "0600" # Define user-provided SSL certificates -#tacker_user_ssl_cert: -#tacker_user_ssl_key: +# tacker_user_ssl_cert: +# tacker_user_ssl_key: diff --git a/meta/main.yml b/meta/main.yml index 3609d5d..0312b06 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -21,20 +21,21 @@ galaxy_info: description: Tacker deployment with OpenStack Ansible company: OpenStack license: Apache2 - - min_ansible_version: 1.9 + role_name: os_tacker + namespace: openstack + min_ansible_version: "2.10" platforms: - - name: Debian - versions: - - buster - - name: Ubuntu - versions: - - bionic - - focal - - name: EL - versions: - - 8 + - name: Debian + versions: + - bullseye + - name: Ubuntu + versions: + - focal + - jammy + - name: EL + versions: + - "9" galaxy_tags: - cloud - openstack diff --git a/tasks/main.yml b/tasks/main.yml index f63892c..280299a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -30,7 +30,8 @@ tags: - always -- include_role: +- name: Including osa.db_setup role + include_role: name: openstack.osa.db_setup apply: tags: @@ -51,7 +52,8 @@ tags: - always -- include_role: +- name: Including osa.mq_setup role + include_role: name: openstack.osa.mq_setup apply: tags: @@ -73,7 +75,8 @@ tags: - always -- import_tasks: tacker_pre_install.yml +- name: Importing tacker_pre_install tasks + import_tasks: tacker_pre_install.yml tags: - tacker-install @@ -114,7 +117,8 @@ tags: - tacker-install -- import_tasks: tacker_post_install.yml +- name: Importing tacker_post_install tasks + import_tasks: tacker_post_install.yml tags: - tacker-install - tacker-config @@ -128,23 +132,25 @@ systemd_tempd_prefix: openstack systemd_slice_name: tacker systemd_lock_path: /var/lock/tacker - systemd_CPUAccounting: true - systemd_BlockIOAccounting: true - systemd_MemoryAccounting: true - systemd_TasksAccounting: true + systemd_service_cpu_accounting: true + systemd_service_block_io_accounting: true + systemd_service_memory_accounting: true + systemd_service_tasks_accounting: true systemd_services: "{{ tacker_services.values() }}" tags: - systemd-service - tacker-install - tacker-config -- import_tasks: tacker_db_sync.yml +- name: Importing tacker_db_sync tasks + import_tasks: tacker_db_sync.yml when: - _tacker_is_first_play_host tags: - tacker-install -- include_role: +- name: Including osa.service_setup role + include_role: name: openstack.osa.service_setup apply: tags: diff --git a/tasks/tacker_messaging_setup.yml b/tasks/tacker_messaging_setup.yml index 4767594..91135fd 100644 --- a/tasks/tacker_messaging_setup.yml +++ b/tasks/tacker_messaging_setup.yml @@ -25,4 +25,3 @@ tags: - tacker-rabbitmq - tacker-rabbitmq-user - diff --git a/tasks/tacker_post_install.yml b/tasks/tacker_post_install.yml index dd8836d..2765b59 100644 --- a/tasks/tacker_post_install.yml +++ b/tasks/tacker_post_install.yml @@ -68,6 +68,7 @@ dest: "{{ tacker_etc_dir }}/rootwrap.d/" owner: "root" group: "root" + mode: "0644" with_fileglob: - rootwrap.d/* notify: diff --git a/tasks/tacker_pre_install.yml b/tasks/tacker_pre_install.yml index e9b4c86..a01eaa1 100644 --- a/tasks/tacker_pre_install.yml +++ b/tasks/tacker_pre_install.yml @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: create the system group +- name: Create the system group group: name: "{{ tacker_system_group_name }}" state: "present" diff --git a/vars/main.yml b/vars/main.yml index 96d474d..dc4c044 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -15,4 +15,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -_tacker_is_first_play_host: "{{ ('tacker_all' in group_names and inventory_hostname == (groups['tacker_all'] | intersect(ansible_play_hosts)) | first) | bool }}" +_tacker_is_first_play_host: >- + {{ ('tacker_all' in group_names and inventory_hostname == (groups['tacker_all'] | intersect(ansible_play_hosts)) | first) | bool }}