diff --git a/defaults/main.yml b/defaults/main.yml index fabca5e..b8259ec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,7 +20,11 @@ debug: False # for the service setup. The host must already have # clouds.yaml properly configured. aodh_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" -aodh_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((aodh_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" +aodh_service_setup_host_python_interpreter: >- + {{ + openstack_service_setup_host_python_interpreter | default( + (aodh_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' @@ -33,7 +37,8 @@ aodh_venv_python_executable: "{{ openstack_venv_python_executable | default('pyt ## The git source/branch aodh_git_repo: https://opendev.org/openstack/aodh aodh_git_install_branch: master -aodh_upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" +aodh_upper_constraints_url: >- + {{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }} aodh_git_constraints: - "--constraint {{ aodh_upper_constraints_url }}" @@ -52,14 +57,21 @@ aodh_system_user_home: "/var/lib/{{ aodh_system_user_name }}" ## Database info aodh_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" -aodh_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((aodh_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}" +aodh_db_setup_python_interpreter: >- + {{ + openstack_db_setup_python_interpreter | default( + (aodh_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) + }} aodh_db_address: "{{ galera_address | default('127.0.0.1') }}" aodh_database_name: aodh aodh_database_user: aodh aodh_db_type: "mysql+pymysql" aodh_galera_use_ssl: "{{ galera_use_ssl | default(False) }}" aodh_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}" -aodh_connection_string: "{{ aodh_db_type }}://{{ aodh_database_user }}:{{ aodh_container_db_password }}@{{ aodh_db_address }}:{{ aodh_galera_port }}/{{ aodh_database_name }}?charset=utf8{% if aodh_galera_use_ssl | bool %}&ssl_verify_cert=true{% if aodh_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ aodh_galera_ssl_ca_cert }}{% endif %}{% endif %}" +aodh_connection_string: >- + {{ aodh_db_type }}://{{ aodh_database_user }}:{{ aodh_container_db_password }}@{{ aodh_db_address }}:{{ aodh_galera_port }}/{{ aodh_database_name + }}?charset=utf8{% if aodh_galera_use_ssl | bool %}&ssl_verify_cert=true{% + if aodh_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ aodh_galera_ssl_ca_cert }}{% endif %}{% endif %} aodh_galera_port: "{{ galera_port | default('3306') }}" aodh_db_max_overflow: "{{ openstack_db_max_overflow | default('50') }}" aodh_db_max_pool_size: "{{ openstack_db_max_pool_size | default('5') }}" @@ -99,12 +111,13 @@ aodh_oslomsg_amqp1_enabled: "{{ aodh_oslomsg_rpc_transport == 'amqp' }}" ## uWSGI setup aodh_wsgi_threads: 1 aodh_wsgi_processes_max: 16 -aodh_wsgi_processes: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, aodh_wsgi_processes_max] | min }}" +aodh_wsgi_processes: >- + {{ [[(ansible_facts['processor_vcpus'] // ansible_facts['processor_threads_per_core']) | default(1), 1] | max * 2, aodh_wsgi_processes_max] | min }} aodh_uwsgi_tls: crt: "{{ aodh_ssl_cert }}" key: "{{ aodh_ssl_key }}" -#Aodh services info +# Aodh services info aodh_service_role_names: - admin - service @@ -255,5 +268,5 @@ aodh_pki_install_certificates: mode: "0600" # Define user-provided SSL certificates -#aodh_user_ssl_cert: -#aodh_user_ssl_key: +# aodh_user_ssl_cert: +# aodh_user_ssl_key: diff --git a/meta/main.yml b/meta/main.yml index 7b03040..3f54a18 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -18,19 +18,21 @@ galaxy_info: description: Installation and setup of aodh company: Rackspace license: Apache2 - min_ansible_version: 2.2 + role_name: os_aodh + namespace: openstack + min_ansible_version: "2.10" platforms: - name: Debian versions: - - buster + - bullseye - name: Ubuntu versions: - - bionic - focal + - jammy - name: EL versions: - - 8 - categories: + - "9" + galaxy_tags: - cloud - python - ceilometer diff --git a/tasks/aodh_install.yml b/tasks/aodh_install.yml index 7909dad..5f45cc5 100644 --- a/tasks/aodh_install.yml +++ b/tasks/aodh_install.yml @@ -19,6 +19,7 @@ section: "aodh" option: "install_method" value: "{{ aodh_install_method }}" + mode: "0644" - name: Refresh local facts to ensure the aodh section is present setup: diff --git a/tasks/aodh_pre_install.yml b/tasks/aodh_pre_install.yml index e39d6d3..be0a9dd 100644 --- a/tasks/aodh_pre_install.yml +++ b/tasks/aodh_pre_install.yml @@ -33,9 +33,9 @@ file: path: "{{ item.path }}" state: directory - owner: "{{ item.owner|default(aodh_system_user_name) }}" - group: "{{ item.group|default(aodh_system_group_name) }}" - mode: "{{ item.mode|default('0755') }}" + owner: "{{ item.owner | default(aodh_system_user_name) }}" + group: "{{ item.group | default(aodh_system_group_name) }}" + mode: "{{ item.mode | default('0755') }}" with_items: - { path: "/openstack/venvs", mode: "0755", owner: "root", group: "root" } - { path: "/etc/aodh" } diff --git a/tasks/main.yml b/tasks/main.yml index c9c493a..f1596c9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -51,7 +51,8 @@ tags: - always -- include_role: +- name: Including osa.db_setup role + include_role: name: openstack.osa.db_setup apply: tags: @@ -72,12 +73,13 @@ tags: - always -- include_role: +- name: Including osa.mq_setup role + include_role: name: openstack.osa.mq_setup apply: tags: - - common-mq - - aodh-config + - common-mq + - aodh-config when: - _aodh_is_first_play_host vars: @@ -94,11 +96,13 @@ tags: - always -- import_tasks: aodh_pre_install.yml +- name: Importing aodh_pre_install install + import_tasks: aodh_pre_install.yml tags: - aodh-install -- import_tasks: aodh_install.yml +- name: Importing aodh_install install + import_tasks: aodh_install.yml tags: - aodh-install @@ -122,7 +126,8 @@ tags: - always -- import_tasks: aodh_post_install.yml +- name: Importing aodh_post_install tasks + import_tasks: aodh_post_install.yml tags: - aodh-config @@ -135,16 +140,17 @@ systemd_tempd_prefix: openstack systemd_slice_name: aodh systemd_lock_path: /var/lock/aodh - 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: "{{ filtered_aodh_services }}" tags: - aodh-config - systemd-service -- import_tasks: aodh_db_sync.yml +- name: Importing aodh_db_sync tasks + import_tasks: aodh_db_sync.yml when: - _aodh_is_first_play_host tags: @@ -160,7 +166,8 @@ - aodh-config - uwsgi -- include_role: +- name: Including osa.service_setup roles + include_role: name: openstack.osa.service_setup apply: tags: diff --git a/vars/distro_install.yml b/vars/distro_install.yml index b5611e5..ce12155 100644 --- a/vars/distro_install.yml +++ b/vars/distro_install.yml @@ -14,7 +14,7 @@ # limitations under the License. aodh_package_list: |- - {% set packages = (aodh_distro_packages + aodh_service_distro_packages) %} + {% set packages = aodh_distro_packages + aodh_service_distro_packages %} {% if aodh_oslomsg_amqp1_enabled | bool %} {% set _ = packages.extend(aodh_oslomsg_amqp1_distro_packages) %} {% endif %} diff --git a/vars/main.yml b/vars/main.yml index 04380a5..6285bbb 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -13,7 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -_aodh_is_first_play_host: "{{ (aodh_services['aodh-api']['group'] in group_names and inventory_hostname == (groups[aodh_services['aodh-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}" +_aodh_is_first_play_host: >- + {{ + (aodh_services['aodh-api']['group'] in group_names and + inventory_hostname == (groups[aodh_services['aodh-api']['group']] | intersect(ansible_play_hosts)) | first) | bool + }} filtered_aodh_services: |- {% set services = [] %} @@ -53,4 +57,4 @@ uwsgi_aodh_services: |- {% set _ = services.update({key: value}) %} {% endif %} {% endfor %} - {{ services }} \ No newline at end of file + {{ services }} diff --git a/vars/redhat.yml b/vars/redhat.yml index 262c84b..08ad2da 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -41,4 +41,3 @@ aodh_oslomsg_amqp1_distro_packages: - cyrus-sasl-lib - cyrus-sasl-plain - cyrus-sasl-md5 - diff --git a/vars/source_install.yml b/vars/source_install.yml index e85eb8e..ae36020 100644 --- a/vars/source_install.yml +++ b/vars/source_install.yml @@ -14,7 +14,7 @@ # limitations under the License. aodh_package_list: |- - {% set packages = (aodh_distro_packages) %} + {% set packages = aodh_distro_packages %} {% if aodh_oslomsg_amqp1_enabled | bool %} {% set _ = packages.extend(aodh_oslomsg_amqp1_distro_packages) %} {% endif %}