diff --git a/ansible/gather-facts.yml b/ansible/gather-facts.yml index 6ff010735b..7cb6de6db8 100644 --- a/ansible/gather-facts.yml +++ b/ansible/gather-facts.yml @@ -37,5 +37,5 @@ with_items: "{{ delegate_hosts }}" # We gathered facts for all hosts in the batch during the first play. when: - - not hostvars[item].module_setup | default(false) + - not hostvars[item].ansible_facts.module_setup | default(false) tags: always diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 393dce76be..4caa873b83 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -535,8 +535,8 @@ supported_policy_format_list: multiple_regions_names: - "{{ openstack_region_name }}" -openstack_service_workers: "{{ [ansible_processor_vcpus, 5]|min }}" -openstack_service_rpc_workers: "{{ [ansible_processor_vcpus, 3]|min }}" +openstack_service_workers: "{{ [ansible_facts.processor_vcpus, 5]|min }}" +openstack_service_rpc_workers: "{{ [ansible_facts.processor_vcpus, 3]|min }}" # Optionally allow Kolla to set sysctl values set_sysctl: "yes" @@ -917,7 +917,7 @@ gnocchi_metric_datadir_volume: "gnocchi" cinder_backend_ceph: "no" cinder_backend_vmwarevc_vmdk: "no" cinder_volume_group: "cinder-volumes" -cinder_target_helper: "{{ 'lioadm' if ansible_os_family == 'RedHat' else 'tgtadm' }}" +cinder_target_helper: "{{ 'lioadm' if ansible_facts.os_family == 'RedHat' else 'tgtadm' }}" # Valid options are [ '', redis, etcd ] cinder_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}" diff --git a/ansible/post-deploy.yml b/ansible/post-deploy.yml index 831d41e713..74c1bfe26c 100644 --- a/ansible/post-deploy.yml +++ b/ansible/post-deploy.yml @@ -7,8 +7,8 @@ template: src: "roles/common/templates/admin-openrc.sh.j2" dest: "{{ node_config }}/admin-openrc.sh" - owner: "{{ ansible_user_uid }}" - group: "{{ ansible_user_gid }}" + owner: "{{ ansible_facts.user_uid }}" + group: "{{ ansible_facts.user_gid }}" mode: 0600 - import_role: diff --git a/ansible/roles/aodh/defaults/main.yml b/ansible/roles/aodh/defaults/main.yml index f5880bc03d..a25839b38b 100644 --- a/ansible/roles/aodh/defaults/main.yml +++ b/ansible/roles/aodh/defaults/main.yml @@ -158,26 +158,26 @@ aodh_notifier_healthcheck: aodh_api_default_volumes: - "{{ node_config_directory }}/aodh-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "aodh:/var/lib/aodh/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/aodh' if aodh_dev_mode | bool else '' }}" aodh_evaluator_default_volumes: - "{{ node_config_directory }}/aodh-evaluator/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/aodh' if aodh_dev_mode | bool else '' }}" aodh_listener_default_volumes: - "{{ node_config_directory }}/aodh-listener/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/aodh' if aodh_dev_mode | bool else '' }}" aodh_notifier_default_volumes: - "{{ node_config_directory }}/aodh-notifier/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/aodh' if aodh_dev_mode | bool else '' }}" diff --git a/ansible/roles/barbican/defaults/main.yml b/ansible/roles/barbican/defaults/main.yml index ccbbd04988..36583a9392 100644 --- a/ansible/roles/barbican/defaults/main.yml +++ b/ansible/roles/barbican/defaults/main.yml @@ -115,20 +115,20 @@ barbican_worker_healthcheck: barbican_api_default_volumes: - "{{ node_config_directory }}/barbican-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "barbican:/var/lib/barbican/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/barbican/barbican:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/barbican' if barbican_dev_mode | bool else '' }}" barbican_keystone_listener_default_volumes: - "{{ node_config_directory }}/barbican-keystone-listener/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/barbican/barbican:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/barbican' if barbican_dev_mode | bool else '' }}" barbican_worker_default_volumes: - "{{ node_config_directory }}/barbican-worker/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/barbican/barbican:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/barbican' if barbican_dev_mode | bool else '' }}" diff --git a/ansible/roles/baremetal/defaults/main.yml b/ansible/roles/baremetal/defaults/main.yml index 2cd767321e..8b569b5871 100644 --- a/ansible/roles/baremetal/defaults/main.yml +++ b/ansible/roles/baremetal/defaults/main.yml @@ -3,14 +3,14 @@ enable_docker_repo: true # Docker APT repository configuration. -docker_apt_url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}" -docker_apt_repo: "deb {{ docker_apt_url }} {{ ansible_distribution_release }} stable" +docker_apt_url: "https://download.docker.com/linux/{{ ansible_facts.distribution | lower }}" +docker_apt_repo: "deb {{ docker_apt_url }} {{ ansible_facts.distribution_release }} stable" docker_apt_key_file: "gpg" docker_apt_key_id: "0EBFCD88" docker_apt_package: "docker-ce" # Docker Yum repository configuration. -docker_yum_url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}" +docker_yum_url: "https://download.docker.com/linux/{{ ansible_facts.distribution | lower }}" docker_yum_baseurl: "{{ docker_yum_url }}/$releasever/$basearch/stable" docker_yum_gpgkey: "{{ docker_yum_url }}/gpg" docker_yum_gpgcheck: true @@ -41,7 +41,7 @@ docker_https_proxy: "" docker_no_proxy: "" # Version of python used to execute Ansible modules. -host_python_version: "{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}" +host_python_version: "{{ ansible_facts.python.version.major }}.{{ ansible_facts.python.version.minor }}" debian_pkg_install: - "{{ docker_apt_package }}" diff --git a/ansible/roles/baremetal/tasks/install.yml b/ansible/roles/baremetal/tasks/install.yml index 18f2bfd7c6..27886e665c 100644 --- a/ansible/roles/baremetal/tasks/install.yml +++ b/ansible/roles/baremetal/tasks/install.yml @@ -3,7 +3,7 @@ apt: update_cache: yes become: True - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' # TODO(inc0): Gates don't seem to have ufw executable, check for it instead of ignore errors - name: Set firewall default policy @@ -11,7 +11,7 @@ ufw: state: disabled policy: allow - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' ignore_errors: yes - name: Check if firewalld is installed @@ -21,7 +21,7 @@ failed_when: firewalld_check.rc > 1 args: warn: false - when: ansible_os_family == 'RedHat' + when: ansible_facts.os_family == 'RedHat' - name: Disable firewalld become: True @@ -32,7 +32,7 @@ with_items: - firewalld when: - - ansible_os_family == 'RedHat' + - ansible_facts.os_family == 'RedHat' - firewalld_check.rc == 0 # Upgrading docker engine may cause containers to stop. Take a snapshot of the @@ -63,7 +63,7 @@ state: link become: true when: - - ansible_os_family == 'Debian' + - ansible_facts.os_family == 'Debian' - not docker_unit_file.stat.exists - name: Install apt packages @@ -71,7 +71,7 @@ name: "{{ (debian_pkg_install | join(' ')).split() }}" state: present become: True - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' register: apt_install_result - name: Install deltarpm packages @@ -80,7 +80,7 @@ state: present update_cache: yes become: True - when: ansible_os_family == 'RedHat' + when: ansible_facts.os_family == 'RedHat' - name: Install RPM packages package: @@ -88,7 +88,7 @@ state: present update_cache: yes become: True - when: ansible_os_family == 'RedHat' + when: ansible_facts.os_family == 'RedHat' register: rpm_install_result # If any packages were updated, and any containers were running, wait for the @@ -122,7 +122,7 @@ - running_containers.rc == 0 - running_containers.stdout != '' vars: - install_result: "{{ rpm_install_result if ansible_os_family == 'RedHat' else apt_install_result }}" + install_result: "{{ rpm_install_result if ansible_facts.os_family == 'RedHat' else apt_install_result }}" - name: Install latest pip in the virtualenv pip: @@ -150,11 +150,11 @@ name: "{{ (ubuntu_pkg_removals | join(' ')).split() }}" state: absent become: True - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' - name: Remove packages package: name: "{{ (redhat_pkg_removals | join(' ')).split() }}" state: absent become: True - when: ansible_os_family == 'RedHat' + when: ansible_facts.os_family == 'RedHat' diff --git a/ansible/roles/baremetal/tasks/post-install.yml b/ansible/roles/baremetal/tasks/post-install.yml index 3061ad3e96..abfa465b91 100644 --- a/ansible/roles/baremetal/tasks/post-install.yml +++ b/ansible/roles/baremetal/tasks/post-install.yml @@ -192,19 +192,19 @@ stat: path: /etc/apparmor.d/usr.sbin.libvirtd register: apparmor_libvirtd_profile - when: ansible_distribution == "Ubuntu" + when: ansible_facts.distribution == "Ubuntu" - name: Get stat of libvirtd apparmor disable profile stat: path: /etc/apparmor.d/disable/usr.sbin.libvirtd register: apparmor_libvirtd_disable_profile - when: ansible_distribution == "Ubuntu" + when: ansible_facts.distribution == "Ubuntu" - name: Remove apparmor profile for libvirt command: apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd become: True when: - - ansible_distribution == "Ubuntu" + - ansible_facts.distribution == "Ubuntu" - apparmor_libvirtd_profile.stat.exists - not apparmor_libvirtd_disable_profile.stat.exists @@ -213,14 +213,14 @@ path: /etc/apparmor.d/usr.sbin.chronyd register: apparmor_chronyd_profile when: - - ansible_os_family == "Debian" + - ansible_facts.os_family == "Debian" - enable_chrony | bool - name: Remove apparmor profile for chrony command: apparmor_parser -R /etc/apparmor.d/usr.sbin.chronyd become: True when: - - ansible_os_family == "Debian" + - ansible_facts.os_family == "Debian" - enable_chrony | bool - apparmor_chronyd_profile.stat.exists @@ -272,7 +272,7 @@ state: stopped become: True when: - - ansible_os_family == "Debian" + - ansible_facts.os_family == "Debian" - enable_host_ntp | bool - name: Stop time service @@ -281,7 +281,7 @@ state: stopped become: True when: - - ansible_os_family == "RedHat" + - ansible_facts.os_family == "RedHat" - enable_host_ntp | bool - name: Synchronizing time one-time @@ -296,7 +296,7 @@ enabled: yes become: True when: - - ansible_os_family == "Debian" + - ansible_facts.os_family == "Debian" - enable_host_ntp | bool - name: Start time sync service @@ -306,7 +306,7 @@ enabled: yes become: True when: - - ansible_os_family == "RedHat" + - ansible_facts.os_family == "RedHat" - enable_host_ntp | bool - name: Change state of selinux @@ -316,4 +316,4 @@ become: true when: - change_selinux | bool - - ansible_os_family == "RedHat" + - ansible_facts.os_family == "RedHat" diff --git a/ansible/roles/baremetal/tasks/pre-install.yml b/ansible/roles/baremetal/tasks/pre-install.yml index 6c4d9bfecc..903bb66e96 100644 --- a/ansible/roles/baremetal/tasks/pre-install.yml +++ b/ansible/roles/baremetal/tasks/pre-install.yml @@ -17,7 +17,7 @@ - name: Ensure hostname does not point to 127.0.1.1 in /etc/hosts lineinfile: dest: /etc/hosts - regexp: "^127.0.1.1\\b.*\\s{{ ansible_hostname }}\\b" + regexp: "^127.0.1.1\\b.*\\s{{ ansible_facts.hostname }}\\b" state: absent become: True when: customize_etc_hosts | bool @@ -28,9 +28,9 @@ marker: "# {mark} ANSIBLE GENERATED HOSTS" block: | {% for host in groups['baremetal'] %} - {% set api_interface = hostvars[host]['api_interface'] | replace('-', '_') %} - {% if host not in groups['bifrost'] or 'ansible_' + api_interface in hostvars[host] %} - {% set hostnames = [hostvars[host]['ansible_nodename'], hostvars[host]['ansible_hostname']] %} + {% set api_interface = hostvars[host]['api_interface'] %} + {% if host not in groups['bifrost'] or api_interface in hostvars[host].ansible_facts %} + {% set hostnames = [hostvars[host].ansible_facts.nodename, hostvars[host].ansible_facts.hostname] %} {{ 'api' | kolla_address(host) }} {{ hostnames | unique | join(' ') }} {% endif %} {% endfor %} @@ -39,7 +39,7 @@ - customize_etc_hosts | bool # Skip hosts in the bifrost group that do not have a valid api_interface. - inventory_hostname not in groups['bifrost'] or - 'ansible_' + hostvars[inventory_hostname]['api_interface'] | replace('-', '_') in hostvars[inventory_hostname] + hostvars[inventory_hostname]['api_interface'] | replace('-', '_') in hostvars[inventory_hostname].ansible_facts # NOTE(osmanlicilegi): The distribution might come with cloud-init installed, and manage_etc_hosts # configuration enabled. If so, it will override the file /etc/hosts from cloud-init templates at @@ -110,7 +110,7 @@ repo: "{{ docker_apt_repo }}" filename: docker become: True - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' - block: - name: Ensure yum repos directory exists @@ -147,5 +147,5 @@ key: "{{ docker_yum_url }}/gpg" become: True when: docker_yum_gpgcheck | bool - when: ansible_os_family == 'RedHat' + when: ansible_facts.os_family == 'RedHat' when: enable_docker_repo | bool diff --git a/ansible/roles/blazar/defaults/main.yml b/ansible/roles/blazar/defaults/main.yml index 2ad285215a..5e9ca5ca36 100644 --- a/ansible/roles/blazar/defaults/main.yml +++ b/ansible/roles/blazar/defaults/main.yml @@ -92,13 +92,13 @@ blazar_manager_healthcheck: blazar_api_default_volumes: - "{{ node_config_directory }}/blazar-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/blazar' if blazar_dev_mode | bool else '' }}" blazar_manager_default_volumes: - "{{ node_config_directory }}/blazar-manager/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/blazar' if blazar_dev_mode | bool else '' }}" diff --git a/ansible/roles/ceilometer/defaults/main.yml b/ansible/roles/ceilometer/defaults/main.yml index 22569fee34..e52b6881bb 100644 --- a/ansible/roles/ceilometer/defaults/main.yml +++ b/ansible/roles/ceilometer/defaults/main.yml @@ -63,20 +63,20 @@ ceilometer_ipmi_dimensions: "{{ default_container_dimensions }}" ceilometer_notification_default_volumes: - "{{ node_config_directory }}/ceilometer-notification/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}" ceilometer_central_default_volumes: - "{{ node_config_directory }}/ceilometer-central/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "ceilometer:/var/lib/ceilometer/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}" ceilometer_compute_default_volumes: - "{{ node_config_directory }}/ceilometer-compute/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/run/:/run/:shared" - "ceilometer:/var/lib/ceilometer/" - "kolla_logs:/var/log/kolla/" @@ -85,7 +85,7 @@ ceilometer_compute_default_volumes: ceilometer_ipmi_default_volumes: - "{{ node_config_directory }}/ceilometer-ipmi/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "ceilometer:/var/lib/ceilometer/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}" diff --git a/ansible/roles/chrony/defaults/main.yml b/ansible/roles/chrony/defaults/main.yml index 727b04a3d2..e74cb135a0 100644 --- a/ansible/roles/chrony/defaults/main.yml +++ b/ansible/roles/chrony/defaults/main.yml @@ -26,6 +26,6 @@ chrony_dimensions: "{{ default_container_dimensions }}" chrony_default_volumes: - "{{ node_config_directory }}/chrony/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" chrony_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 9ea5faf401..c750672876 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -143,13 +143,13 @@ cinder_backup_healthcheck: cinder_api_default_volumes: - "{{ node_config_directory }}/cinder-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/cinder' if cinder_dev_mode | bool else '' }}" cinder_backup_default_volumes: - "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/lib/modules:/lib/modules:ro" - "/run/:/run/:shared" @@ -160,13 +160,13 @@ cinder_backup_default_volumes: cinder_scheduler_default_volumes: - "{{ node_config_directory }}/cinder-scheduler/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/cinder' if cinder_dev_mode | bool else '' }}" cinder_volume_default_volumes: - "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/lib/modules:/lib/modules:ro" - "/run/:/run/:shared" diff --git a/ansible/roles/cloudkitty/defaults/main.yml b/ansible/roles/cloudkitty/defaults/main.yml index e34cd82a67..14ac9145c8 100644 --- a/ansible/roles/cloudkitty/defaults/main.yml +++ b/ansible/roles/cloudkitty/defaults/main.yml @@ -59,13 +59,13 @@ cloudkitty_api_dimensions: "{{ default_container_dimensions }}" cloudkitty_api_default_volumes: - "{{ node_config_directory }}/cloudkitty-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/cloudkitty/cloudkitty:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/cloudkitty' if cloudkitty_dev_mode | bool else '' }}" cloudkitty_processor_default_volumes: - "{{ node_config_directory }}/cloudkitty-processor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/cloudkitty/cloudkitty:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/cloudkitty' if cloudkitty_dev_mode | bool else '' }}" diff --git a/ansible/roles/collectd/defaults/main.yml b/ansible/roles/collectd/defaults/main.yml index 4b4640b7f5..f9bd7d6a0a 100644 --- a/ansible/roles/collectd/defaults/main.yml +++ b/ansible/roles/collectd/defaults/main.yml @@ -25,7 +25,7 @@ collectd_default_volumes: - "{{ node_config_directory }}/collectd/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/collectd/collectd.conf.d/:/etc/collectd/collectd.conf.d/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "/sys/:/sys/:ro" - "/dev/:/dev/:ro" diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml index 9b7c32646a..b68c8be3b4 100644 --- a/ansible/roles/common/defaults/main.yml +++ b/ansible/roles/common/defaults/main.yml @@ -75,7 +75,7 @@ syslog_neutron_tls_proxy_facility: "local4" kolla_toolbox_default_volumes: - "{{ node_config_directory }}/kolla-toolbox/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/run/:/run/:shared" - "kolla_logs:/var/log/kolla/" @@ -83,12 +83,12 @@ kolla_toolbox_default_volumes: cron_default_volumes: - "{{ node_config_directory }}/cron/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" fluentd_default_volumes: - "{{ node_config_directory }}/fluentd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "fluentd_data:/var/lib/fluentd/data/" kolla_toolbox_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/common/templates/conf/input/03-rabbitmq.conf.j2 b/ansible/roles/common/templates/conf/input/03-rabbitmq.conf.j2 index f70c5bdb5d..91df08d37d 100644 --- a/ansible/roles/common/templates/conf/input/03-rabbitmq.conf.j2 +++ b/ansible/roles/common/templates/conf/input/03-rabbitmq.conf.j2 @@ -1,6 +1,6 @@ @type tail - path /var/log/kolla/rabbitmq/rabbit@{{ ansible_hostname }}.log + path /var/log/kolla/rabbitmq/rabbit@{{ ansible_facts.hostname }}.log pos_file /var/run/{{ fluentd_binary }}/rabbit.pos tag infra.rabbit format multiline diff --git a/ansible/roles/cyborg/defaults/main.yml b/ansible/roles/cyborg/defaults/main.yml index 2150d08c11..fa079e118a 100644 --- a/ansible/roles/cyborg/defaults/main.yml +++ b/ansible/roles/cyborg/defaults/main.yml @@ -99,20 +99,20 @@ cyborg_conductor_healthcheck: cyborg_api_default_volumes: - "{{ node_config_directory }}/cyborg-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "cyborg:/var/lib/cyborg/" - "kolla_logs:/var/log/kolla/" cyborg_agent_default_volumes: - "{{ node_config_directory }}/cyborg-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" cyborg_conductor_default_volumes: - "{{ node_config_directory }}/cyborg-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" cyborg_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/designate/defaults/main.yml b/ansible/roles/designate/defaults/main.yml index 2f38b68543..633f96681a 100644 --- a/ansible/roles/designate/defaults/main.yml +++ b/ansible/roles/designate/defaults/main.yml @@ -217,43 +217,43 @@ designate_sink_healthcheck: designate_api_default_volumes: - "{{ node_config_directory }}/designate-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/designate' if designate_dev_mode | bool else '' }}" designate_backend_bind9_default_volumes: - "{{ node_config_directory }}/designate-backend-bind9/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "designate_backend_bind9:/var/lib/named/" designate_central_default_volumes: - "{{ node_config_directory }}/designate-central/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/designate' if designate_dev_mode | bool else '' }}" designate_mdns_default_volumes: - "{{ node_config_directory }}/designate-mdns/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/designate' if designate_dev_mode | bool else '' }}" designate_producer_default_volumes: - "{{ node_config_directory }}/designate-producer/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/designate' if designate_dev_mode | bool else '' }}" designate_worker_default_volumes: - "{{ node_config_directory }}/designate-worker/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/designate' if designate_dev_mode | bool else '' }}" designate_sink_default_volumes: - "{{ node_config_directory }}/designate-sink/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/designate' if designate_dev_mode | bool else '' }}" diff --git a/ansible/roles/elasticsearch/defaults/main.yml b/ansible/roles/elasticsearch/defaults/main.yml index 9285298843..10232d6997 100644 --- a/ansible/roles/elasticsearch/defaults/main.yml +++ b/ansible/roles/elasticsearch/defaults/main.yml @@ -118,13 +118,13 @@ elasticsearch_healthcheck: elasticsearch_default_volumes: - "{{ node_config_directory }}/elasticsearch/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ elasticsearch_datadir_volume }}:/var/lib/elasticsearch/data" - "kolla_logs:/var/log/kolla/" elasticsearch_curator_default_volumes: - "{{ node_config_directory }}/elasticsearch-curator/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" elasticsearch_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/etcd/defaults/main.yml b/ansible/roles/etcd/defaults/main.yml index bca599286f..fd74d91420 100644 --- a/ansible/roles/etcd/defaults/main.yml +++ b/ansible/roles/etcd/defaults/main.yml @@ -8,13 +8,13 @@ etcd_services: enabled: true environment: ETCD_DATA_DIR: "/var/lib/etcd" - ETCD_NAME: "{{ ansible_hostname }}" + ETCD_NAME: "{{ ansible_facts.hostname }}" ETCD_ADVERTISE_CLIENT_URLS: "{{ etcd_client_internal_endpoint }}" ETCD_LISTEN_CLIENT_URLS: "{{ etcd_client_internal_endpoint }}" ETCD_INITIAL_ADVERTISE_PEER_URLS: "{{ etcd_peer_internal_endpoint }}" ETCD_LISTEN_PEER_URLS: "{{ etcd_peer_internal_endpoint }}" ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_cluster_token }}" - ETCD_INITIAL_CLUSTER: "{% for host in groups['etcd'] %}{{ hostvars[host]['ansible_hostname'] }}={{ etcd_protocol }}://{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}{% endfor %}" + ETCD_INITIAL_CLUSTER: "{% for host in groups['etcd'] %}{{ hostvars[host].ansible_facts.hostname }}={{ etcd_protocol }}://{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}{% endfor %}" ETCD_INITIAL_CLUSTER_STATE: "new" ETCD_OUT_FILE: "/var/log/kolla/etcd/etcd.log" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" @@ -39,7 +39,7 @@ etcd_dimensions: "{{ default_container_dimensions }}" etcd_default_volumes: - "{{ node_config_directory }}/etcd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_etcd:/var/lib/etcd/" - "kolla_logs:/var/log/kolla/" etcd_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/freezer/defaults/main.yml b/ansible/roles/freezer/defaults/main.yml index 379b5fb5ed..d0471e9892 100644 --- a/ansible/roles/freezer/defaults/main.yml +++ b/ansible/roles/freezer/defaults/main.yml @@ -60,14 +60,14 @@ freezer_scheduler_dimensions: "{{ default_container_dimensions }}" freezer_api_default_volumes: - "{{ node_config_directory }}/freezer-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "freezer:/var/lib/freezer/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/freezer-api/freezer_api:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/freezer_api' if freezer_dev_mode | bool else '' }}" freezer_scheduler_default_volumes: - "{{ node_config_directory }}/freezer-scheduler/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "freezer:/var/lib/freezer/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/freezer/freezer:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/freezer' if freezer_dev_mode | bool else '' }}" diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml index 9bd0984347..9a1d93e30d 100644 --- a/ansible/roles/glance/defaults/main.yml +++ b/ansible/roles/glance/defaults/main.yml @@ -70,8 +70,8 @@ glance_services: #################### # HAProxy #################### -haproxy_members: "{% for host in glance_api_hosts %}server {{ hostvars[host]['ansible_hostname'] }} {{ 'api' | kolla_address(host) }}:{{ glance_api_listen_port }} check inter 2000 rise 2 fall 5;{% endfor %}" -haproxy_tls_members: "{% for host in glance_api_hosts %}server {{ hostvars[host]['ansible_hostname'] }} {{ 'api' | kolla_address(host) }}:{{ glance_api_listen_port }} check inter 2000 rise 2 fall 5 ssl verify required ca-file {{ haproxy_backend_cacert }};{% endfor %}" +haproxy_members: "{% for host in glance_api_hosts %}server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ glance_api_listen_port }} check inter 2000 rise 2 fall 5;{% endfor %}" +haproxy_tls_members: "{% for host in glance_api_hosts %}server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ glance_api_listen_port }} check inter 2000 rise 2 fall 5 ssl verify required ca-file {{ haproxy_backend_cacert }};{% endfor %}" #################### # Keystone @@ -161,7 +161,7 @@ glance_tls_proxy_healthcheck: glance_api_default_volumes: - "{{ node_config_directory }}/glance-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ glance_file_datadir_volume }}:/var/lib/glance/" - "{{ kolla_dev_repos_directory ~ '/glance/glance:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/glance' if glance_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" @@ -171,7 +171,7 @@ glance_api_default_volumes: glance_tls_proxy_default_volumes: - "{{ node_config_directory }}/glance-tls-proxy/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" glance_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/gnocchi/defaults/main.yml b/ansible/roles/gnocchi/defaults/main.yml index 7ebfb079a4..dd14921242 100644 --- a/ansible/roles/gnocchi/defaults/main.yml +++ b/ansible/roles/gnocchi/defaults/main.yml @@ -118,21 +118,21 @@ gnocchi_statsd_healthcheck: gnocchi_api_default_volumes: - "{{ node_config_directory }}/gnocchi-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ gnocchi_metric_datadir_volume }}:/var/lib/gnocchi/" - "kolla_logs:/var/log/kolla/" gnocchi_metricd_default_volumes: - "{{ node_config_directory }}/gnocchi-metricd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ gnocchi_metric_datadir_volume }}:/var/lib/gnocchi/" - "kolla_logs:/var/log/kolla/" gnocchi_statsd_default_volumes: - "{{ node_config_directory }}/gnocchi-statsd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ gnocchi_metric_datadir_volume }}:/var/lib/gnocchi/" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/grafana/defaults/main.yml b/ansible/roles/grafana/defaults/main.yml index 06d6ff66cb..05593064bb 100644 --- a/ansible/roles/grafana/defaults/main.yml +++ b/ansible/roles/grafana/defaults/main.yml @@ -76,7 +76,7 @@ grafana_dimensions: "{{ default_container_dimensions }}" grafana_default_volumes: - "{{ node_config_directory }}/grafana/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "grafana:/var/lib/grafana/" - "kolla_logs:/var/log/kolla/" grafana_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/hacluster/tasks/bootstrap_service.yml b/ansible/roles/hacluster/tasks/bootstrap_service.yml index 8bf67213b9..be4f057ae8 100644 --- a/ansible/roles/hacluster/tasks/bootstrap_service.yml +++ b/ansible/roles/hacluster/tasks/bootstrap_service.yml @@ -15,12 +15,12 @@ docker exec {{ pacemaker_service.container_name }} cibadmin --modify --scope resources -X ' - - - + + + - + diff --git a/ansible/roles/hacluster/templates/hacluster_corosync.conf.j2 b/ansible/roles/hacluster/templates/hacluster_corosync.conf.j2 index 198c19e2bd..6547272a27 100644 --- a/ansible/roles/hacluster/templates/hacluster_corosync.conf.j2 +++ b/ansible/roles/hacluster/templates/hacluster_corosync.conf.j2 @@ -13,7 +13,7 @@ nodelist { {% for host in groups['hacluster'] | sort %} node { ring0_addr: {{ 'api' | kolla_address(host) }} - name: {{ hostvars[host]['ansible_hostname'] }} + name: {{ hostvars[host].ansible_facts.hostname }} nodeid: {{ loop.index }} } {% endfor %} diff --git a/ansible/roles/haproxy-config/templates/haproxy_single_service_listen.cfg.j2 b/ansible/roles/haproxy-config/templates/haproxy_single_service_listen.cfg.j2 index 16076da504..5645c77989 100644 --- a/ansible/roles/haproxy-config/templates/haproxy_single_service_listen.cfg.j2 +++ b/ansible/roles/haproxy-config/templates/haproxy_single_service_listen.cfg.j2 @@ -71,7 +71,7 @@ listen {{ service_name }} {% set haproxy_health_check_final = haproxy_health_check %} {% endif %} {% for host in groups[host_group] %} - {% set host_name = hostvars[host]['ansible_hostname'] %} + {% set host_name = hostvars[host].ansible_facts.hostname %} {% set host_ip = 'api' | kolla_address(host) %} server {{ host_name }} {{ host_ip }}:{{ listen_port }} {{ haproxy_health_check_final }} {{ backend_tls_info }} {% endfor %} diff --git a/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 b/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 index f5e2fa9f7a..d5ff4dfb69 100644 --- a/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 +++ b/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 @@ -91,7 +91,7 @@ backend {{ service_name }}_back {% set haproxy_health_check_final = haproxy_health_check %} {% endif %} {% for host in groups[host_group] %} - {% set host_name = hostvars[host]['ansible_hostname'] %} + {% set host_name = hostvars[host].ansible_facts.hostname %} {% set host_ip = 'api' | kolla_address(host) %} server {{ host_name }} {{ host_ip }}:{{ listen_port }} {{ haproxy_health_check_final }} {{ backend_tls_info }} {% endfor %} diff --git a/ansible/roles/haproxy/defaults/main.yml b/ansible/roles/haproxy/defaults/main.yml index c596e03152..145d595e37 100644 --- a/ansible/roles/haproxy/defaults/main.yml +++ b/ansible/roles/haproxy/defaults/main.yml @@ -66,12 +66,12 @@ haproxy_healthcheck: haproxy_default_volumes: - "{{ node_config_directory }}/haproxy/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "haproxy_socket:/var/lib/kolla/haproxy/" keepalived_default_volumes: - "{{ node_config_directory }}/keepalived/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "haproxy_socket:/var/lib/kolla/haproxy/" diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index a914be611c..6f23cf73d5 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -83,13 +83,13 @@ fail: "msg='Please check the kolla_external_vip_interface property - interface {{ kolla_external_vip_interface }} not found'" when: - haproxy_enable_external_vip | bool - - kolla_external_vip_interface not in ansible_interfaces + - kolla_external_vip_interface not in ansible_facts.interfaces - name: Checking the kolla_external_vip_interface is active fail: "msg='Please check the kolla_external_vip_interface settings - interface {{ kolla_external_vip_interface }} is not active'" when: - haproxy_enable_external_vip | bool - - not hostvars[inventory_hostname]['ansible_' + kolla_external_vip_interface]['active'] + - not hostvars[inventory_hostname].ansible_facts[kolla_external_vip_interface]['active'] - name: Checking if kolla_internal_vip_address and kolla_external_vip_address are not pingable from any node command: "{{ item.command }} -c 3 {{ item.address }}" diff --git a/ansible/roles/heat/defaults/main.yml b/ansible/roles/heat/defaults/main.yml index e725548618..f3b6d5f4b5 100644 --- a/ansible/roles/heat/defaults/main.yml +++ b/ansible/roles/heat/defaults/main.yml @@ -129,19 +129,19 @@ heat_engine_healthcheck: heat_api_default_volumes: - "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/heat/heat:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/heat' if heat_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" heat_api_cfn_default_volumes: - "{{ node_config_directory }}/heat-api-cfn/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/heat/heat:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/heat' if heat_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" heat_engine_default_volumes: - "{{ node_config_directory }}/heat-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/heat/heat:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/heat' if heat_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/horizon/defaults/main.yml b/ansible/roles/horizon/defaults/main.yml index 5594f6e508..1cecac3afa 100644 --- a/ansible/roles/horizon/defaults/main.yml +++ b/ansible/roles/horizon/defaults/main.yml @@ -113,7 +113,7 @@ horizon_default_volumes: - "{{ kolla_dev_repos_directory ~ '/horizon/openstack_dashboard:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/openstack_dashboard' if horizon_dev_mode | bool else '' }}" - "{{ kolla_dev_repos_directory ~ '/murano-dashboard/muranodashboard:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/muranodashboard' if horizon_murano_dev_mode | bool else '' }}" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "/tmp:/tmp" diff --git a/ansible/roles/influxdb/defaults/main.yml b/ansible/roles/influxdb/defaults/main.yml index 6f9fb7cda2..b84436f6cc 100644 --- a/ansible/roles/influxdb/defaults/main.yml +++ b/ansible/roles/influxdb/defaults/main.yml @@ -37,7 +37,7 @@ influxdb_dimensions: "{{ default_container_dimensions }}" influxdb_default_volumes: - "{{ node_config_directory }}/influxdb/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ influxdb_datadir_volume }}:/var/lib/influxdb" - "kolla_logs:/var/log/kolla/" influxdb_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/ironic/defaults/main.yml b/ansible/roles/ironic/defaults/main.yml index 414889c85b..3f2e99abac 100644 --- a/ansible/roles/ironic/defaults/main.yml +++ b/ansible/roles/ironic/defaults/main.yml @@ -182,13 +182,13 @@ ironic_ipxe_healthcheck: ironic_api_default_volumes: - "{{ node_config_directory }}/ironic-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "{{ kolla_dev_repos_directory ~ '/ironic/ironic:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/ironic' if ironic_dev_mode | bool else '' }}" ironic_conductor_default_volumes: - "{{ node_config_directory }}/ironic-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/sys:/sys" - "/dev:/dev" @@ -201,27 +201,27 @@ ironic_conductor_default_volumes: ironic_pxe_default_volumes: - "{{ node_config_directory }}/ironic-pxe/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "ironic_pxe:/tftpboot/" - "kolla_logs:/var/log/kolla" ironic_ipxe_default_volumes: - "{{ node_config_directory }}/ironic-ipxe/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "ironic:/var/lib/ironic:ro" - "ironic_ipxe:/httpboot/" - "kolla_logs:/var/log/kolla" ironic_inspector_default_volumes: - "{{ node_config_directory }}/ironic-inspector/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "ironic_inspector_dhcp_hosts:/var/lib/ironic-inspector/dhcp-hostsdir" - "{{ kolla_dev_repos_directory ~ '/ironic-inspector/ironic_inspector:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/ironic_inspector' if ironic_dev_mode | bool else '' }}" ironic_dnsmasq_default_volumes: - "{{ node_config_directory }}/ironic-dnsmasq/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "ironic_inspector_dhcp_hosts:/etc/dnsmasq/dhcp-hostsdir:ro" diff --git a/ansible/roles/iscsi/defaults/main.yml b/ansible/roles/iscsi/defaults/main.yml index 25280c69d5..d9c3817cd5 100644 --- a/ansible/roles/iscsi/defaults/main.yml +++ b/ansible/roles/iscsi/defaults/main.yml @@ -43,7 +43,7 @@ iscsid_default_volumes: - "{{ node_config_directory }}/iscsid/:{{ container_config_directory }}/:ro" - "kolla_logs:/var/log/kolla/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/run/:/run/:shared" - "/lib/modules:/lib/modules:ro" @@ -54,7 +54,7 @@ tgtd_default_volumes: - "{{ node_config_directory }}/tgtd/:{{ container_config_directory }}/:ro" - "kolla_logs:/var/log/kolla/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/run/:/run/:shared" - "/lib/modules:/lib/modules:ro" diff --git a/ansible/roles/iscsi/tasks/precheck.yml b/ansible/roles/iscsi/tasks/precheck.yml index eee022bf6d..858ce7dbd2 100644 --- a/ansible/roles/iscsi/tasks/precheck.yml +++ b/ansible/roles/iscsi/tasks/precheck.yml @@ -29,5 +29,5 @@ msg: The SCSI target daemon tgtd is not supported on CentOS/RHEL 8 and later when: - - ansible_os_family == 'RedHat' + - ansible_facts.os_family == 'RedHat' - enable_tgtd | bool diff --git a/ansible/roles/kafka/defaults/main.yml b/ansible/roles/kafka/defaults/main.yml index 0cb1641185..a5709279d6 100644 --- a/ansible/roles/kafka/defaults/main.yml +++ b/ansible/roles/kafka/defaults/main.yml @@ -48,7 +48,7 @@ kafka_healthcheck: kafka_default_volumes: - "{{ node_config_directory }}/kafka/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kafka_datadir_volume }}:/var/lib/kafka/data" - "kolla_logs:/var/log/kolla/" kafka_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/keystone/defaults/main.yml b/ansible/roles/keystone/defaults/main.yml index 1c75f5790f..e07bda1304 100644 --- a/ansible/roles/keystone/defaults/main.yml +++ b/ansible/roles/keystone/defaults/main.yml @@ -42,7 +42,7 @@ keystone_services: volumes: - "{{ node_config_directory }}/keystone-ssh/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "keystone_fernet_tokens:/etc/keystone/fernet-keys" dimensions: "{{ keystone_ssh_dimensions }}" @@ -55,7 +55,7 @@ keystone_services: volumes: - "{{ node_config_directory }}/keystone-fernet/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "keystone_fernet_tokens:/etc/keystone/fernet-keys" dimensions: "{{ keystone_fernet_dimensions }}" @@ -126,7 +126,7 @@ keystone_ssh_healthcheck: keystone_default_volumes: - "{{ node_config_directory }}/keystone/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/keystone/keystone:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/keystone' if keystone_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" - "{% if keystone_token_provider == 'fernet' %}keystone_fernet_tokens:/etc/keystone/fernet-keys{% endif %}" diff --git a/ansible/roles/kibana/defaults/main.yml b/ansible/roles/kibana/defaults/main.yml index 67c2a69e95..48bbad0cc5 100644 --- a/ansible/roles/kibana/defaults/main.yml +++ b/ansible/roles/kibana/defaults/main.yml @@ -61,6 +61,6 @@ kibana_healthcheck: kibana_default_volumes: - "{{ node_config_directory }}/kibana/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" kibana_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/kuryr/defaults/main.yml b/ansible/roles/kuryr/defaults/main.yml index a9ef18fe1a..4d2e4cab7f 100644 --- a/ansible/roles/kuryr/defaults/main.yml +++ b/ansible/roles/kuryr/defaults/main.yml @@ -32,7 +32,7 @@ kuryr_image_full: "{{ kuryr_image }}:{{ kuryr_tag }}" kuryr_default_volumes: - "{{ node_config_directory }}/kuryr/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run:/run:shared" - "/usr/lib/docker:/usr/lib/docker" diff --git a/ansible/roles/magnum/defaults/main.yml b/ansible/roles/magnum/defaults/main.yml index 8333bb6734..ad708c89e3 100644 --- a/ansible/roles/magnum/defaults/main.yml +++ b/ansible/roles/magnum/defaults/main.yml @@ -97,13 +97,13 @@ magnum_conductor_healthcheck: magnum_api_default_volumes: - "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/magnum/magnum:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/magnum' if magnum_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" magnum_conductor_default_volumes: - "{{ node_config_directory }}/magnum-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "magnum:/var/lib/magnum/" - "{{ kolla_dev_repos_directory ~ '/magnum/magnum:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/magnum' if magnum_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/manila/defaults/main.yml b/ansible/roles/manila/defaults/main.yml index fd5ac4c98b..84bdc3c853 100644 --- a/ansible/roles/manila/defaults/main.yml +++ b/ansible/roles/manila/defaults/main.yml @@ -139,7 +139,7 @@ manila_data_healthcheck: manila_share_default_volumes: - "{{ node_config_directory }}/manila-share/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/run/:/run/:shared" - "kolla_logs:/var/log/kolla/" - "/lib/modules:/lib/modules:ro" @@ -147,19 +147,19 @@ manila_share_default_volumes: manila_scheduler_default_volumes: - "{{ node_config_directory }}/manila-scheduler/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/manila/manila:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/manila' if manila_dev_mode | bool else '' }}" manila_api_default_volumes: - "{{ node_config_directory }}/manila-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/manila/manila:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/manila' if manila_dev_mode | bool else '' }}" manila_data_default_volumes: - "{{ node_config_directory }}/manila-data/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/run/:/run/:shared" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/mariadb/defaults/main.yml b/ansible/roles/mariadb/defaults/main.yml index 91e5f0d5ab..4ee3a0386b 100644 --- a/ansible/roles/mariadb/defaults/main.yml +++ b/ansible/roles/mariadb/defaults/main.yml @@ -57,7 +57,7 @@ database_max_timeout: 120 #################### # HAProxy #################### -internal_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ hostvars[host]['ansible_hostname'] }} {{ 'api' | kolla_address(host) }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" +internal_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" external_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ host }} {{ host }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" #################### @@ -79,13 +79,13 @@ mariadb_clustercheck_dimensions: "{{ default_container_dimensions }}" mariadb_default_volumes: - "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "mariadb:/var/lib/mysql" - "kolla_logs:/var/log/kolla/" mariadb_clustercheck_default_volumes: - "{{ node_config_directory }}/mariadb-clustercheck/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" mariadb_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2 index e1f53c0985..f0a0474f59 100644 --- a/ansible/roles/mariadb/templates/galera.cnf.j2 +++ b/ansible/roles/mariadb/templates/galera.cnf.j2 @@ -36,7 +36,7 @@ wsrep_sst_receive_address={{ api_interface_address | put_address_in_context('url wsrep_provider={{ wsrep_driver }} wsrep_cluster_name="{{ database_cluster_name }}" -wsrep_node_name={{ ansible_hostname }} +wsrep_node_name={{ ansible_facts.hostname }} wsrep_sst_method={{ sst_method }} wsrep_sst_auth={{ database_user }}:{{ database_password }} wsrep_slave_threads=4 @@ -50,7 +50,7 @@ max_connections=10000 key_buffer_size = '64M' max_heap_table_size = '64M' tmp_table_size = '64M' -{% set dynamic_pool_size_mb = (hostvars[inventory_hostname]['ansible_memtotal_mb'] * 0.4) | round | int %} +{% set dynamic_pool_size_mb = (hostvars[inventory_hostname].ansible_facts.memtotal_mb * 0.4) | round | int %} {% if dynamic_pool_size_mb < 8192 %} innodb_buffer_pool_size = '{{ dynamic_pool_size_mb }}M' {% else %} diff --git a/ansible/roles/masakari/defaults/main.yml b/ansible/roles/masakari/defaults/main.yml index 28d8bb57ef..2c38dffdc8 100644 --- a/ansible/roles/masakari/defaults/main.yml +++ b/ansible/roles/masakari/defaults/main.yml @@ -86,20 +86,20 @@ masakari_hostmonitor_extra_volumes: "{{ masakari_extra_volumes }}" masakari_api_default_volumes: - "{{ node_config_directory }}/masakari-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/masakari/masakari:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/masakari' if masakari_dev_mode | bool else '' }}" masakari_engine_default_volumes: - "{{ node_config_directory }}/masakari-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/masakari/masakari:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/masakari' if masakari_dev_mode | bool else '' }}" - "masakari:/var/lib/masakari/" masakari_instancemonitor_default_volumes: - "{{ node_config_directory }}/masakari-instancemonitor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/masakari-monitors/masakarimonitors:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/masakarimonitors' if masakari_dev_mode | bool else '' }}" masakari_hostmonitor_default_volumes: diff --git a/ansible/roles/memcached/defaults/main.yml b/ansible/roles/memcached/defaults/main.yml index 4aa4858b08..6570bda894 100644 --- a/ansible/roles/memcached/defaults/main.yml +++ b/ansible/roles/memcached/defaults/main.yml @@ -25,7 +25,7 @@ memcached_services: #################### # HAProxy #################### -haproxy_members: "{% for host in groups['memcached'] %}server {{ hostvars[host]['ansible_hostname'] }} {{ 'api' | kolla_address(host) }}:{{ memcached_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" +haproxy_members: "{% for host in groups['memcached'] %}server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ memcached_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" #################### # Docker @@ -39,7 +39,7 @@ memcached_dimensions: "{{ default_container_dimensions }}" memcached_default_volumes: - "{{ node_config_directory }}/memcached/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" memcached_extra_volumes: "{{ default_extra_volumes }}" #################### diff --git a/ansible/roles/mistral/defaults/main.yml b/ansible/roles/mistral/defaults/main.yml index d84c444770..03b7c678c7 100644 --- a/ansible/roles/mistral/defaults/main.yml +++ b/ansible/roles/mistral/defaults/main.yml @@ -81,25 +81,25 @@ mistral_api_dimensions: "{{ default_container_dimensions }}" mistral_engine_default_volumes: - "{{ node_config_directory }}/mistral-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/mistral' if mistral_dev_mode | bool else '' }}" mistral_event_engine_default_volumes: - "{{ node_config_directory }}/mistral-event-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/mistral' if mistral_dev_mode | bool else '' }}" mistral_executor_default_volumes: - "{{ node_config_directory }}/mistral-executor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/mistral' if mistral_dev_mode | bool else '' }}" mistral_api_default_volumes: - "{{ node_config_directory }}/mistral-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/mistral' if mistral_dev_mode | bool else '' }}" diff --git a/ansible/roles/monasca/defaults/main.yml b/ansible/roles/monasca/defaults/main.yml index ab5c8f8d6b..1010f92bd8 100644 --- a/ansible/roles/monasca/defaults/main.yml +++ b/ansible/roles/monasca/defaults/main.yml @@ -274,63 +274,63 @@ monasca_grafana_dimensions: "{{ default_container_dimensions }}" monasca_agent_collector_default_volumes: - "{{ node_config_directory }}/monasca-agent-collector/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "/sys:/sys:ro" - "/dev/disk/:/dev/disk:ro" monasca_agent_statsd_default_volumes: - "{{ node_config_directory }}/monasca-agent-statsd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" monasca_agent_forwarder_default_volumes: - "{{ node_config_directory }}/monasca-agent-forwarder/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" monasca_api_default_volumes: - "{{ node_config_directory }}/monasca-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" monasca_log_transformer_default_volumes: - "{{ node_config_directory }}/monasca-log-transformer/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "monasca_log_transformer_data:/var/lib/logstash" monasca_log_persister_default_volumes: - "{{ node_config_directory }}/monasca-log-persister/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "monasca_log_persister_data:/var/lib/logstash" monasca_log_metrics_default_volumes: - "{{ node_config_directory }}/monasca-log-metrics/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "monasca_log_metrics_data:/var/lib/logstash" monasca_thresh_default_volumes: - "{{ node_config_directory }}/monasca-thresh/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "monasca_thresh:/var/lib/monasca-thresh/" - "kolla_logs:/var/log/kolla" monasca_notification_default_volumes: - "{{ node_config_directory }}/monasca-notification/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" monasca_persister_default_volumes: - "{{ node_config_directory }}/monasca-persister/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" monasca_grafana_default_volumes: - "{{ node_config_directory }}/monasca-grafana/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" monasca_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/monasca/templates/monasca-agent-collector/agent-collector.yml.j2 b/ansible/roles/monasca/templates/monasca-agent-collector/agent-collector.yml.j2 index ebba898f42..c5245f3601 100644 --- a/ansible/roles/monasca/templates/monasca-agent-collector/agent-collector.yml.j2 +++ b/ansible/roles/monasca/templates/monasca-agent-collector/agent-collector.yml.j2 @@ -1,5 +1,5 @@ Main: - hostname: {{ ansible_hostname }} + hostname: {{ ansible_facts.hostname }} check_freq: {{ monasca_agent_check_frequency }} forwarder_url: http://127.0.0.1:{{ monasca_agent_forwarder_port }} diff --git a/ansible/roles/monasca/templates/monasca-agent-forwarder/agent-forwarder.yml.j2 b/ansible/roles/monasca/templates/monasca-agent-forwarder/agent-forwarder.yml.j2 index ea9dfd795a..84365caed6 100644 --- a/ansible/roles/monasca/templates/monasca-agent-forwarder/agent-forwarder.yml.j2 +++ b/ansible/roles/monasca/templates/monasca-agent-forwarder/agent-forwarder.yml.j2 @@ -16,7 +16,7 @@ Api: max_batch_size: {{ monasca_agent_max_batch_size }} Main: - hostname: {{ ansible_hostname }} + hostname: {{ ansible_facts.hostname }} non_local_traffic: True listen_port: {{ monasca_agent_forwarder_port }} diff --git a/ansible/roles/monasca/templates/monasca-agent-statsd/agent-statsd.yml.j2 b/ansible/roles/monasca/templates/monasca-agent-statsd/agent-statsd.yml.j2 index 549400c055..36fa7d9fd2 100644 --- a/ansible/roles/monasca/templates/monasca-agent-statsd/agent-statsd.yml.j2 +++ b/ansible/roles/monasca/templates/monasca-agent-statsd/agent-statsd.yml.j2 @@ -1,5 +1,5 @@ Main: - hostname: {{ ansible_hostname }} + hostname: {{ ansible_facts.hostname }} forwarder_url: http://127.0.0.1:{{ monasca_agent_forwarder_port }} Statsd: diff --git a/ansible/roles/multipathd/defaults/main.yml b/ansible/roles/multipathd/defaults/main.yml index dc5b0cd19d..5dafe98b48 100644 --- a/ansible/roles/multipathd/defaults/main.yml +++ b/ansible/roles/multipathd/defaults/main.yml @@ -24,7 +24,7 @@ multipathd_default_volumes: - "{{ node_config_directory }}/multipathd/:{{ container_config_directory }}/:ro" - "kolla_logs:/var/log/kolla/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/dev/:/dev/" - "/run/:/run/:shared" - "/lib/modules:/lib/modules:ro" diff --git a/ansible/roles/murano/defaults/main.yml b/ansible/roles/murano/defaults/main.yml index e17e55584f..6bc2534c0f 100644 --- a/ansible/roles/murano/defaults/main.yml +++ b/ansible/roles/murano/defaults/main.yml @@ -58,13 +58,13 @@ murano_api_default_volumes: - "{{ node_config_directory }}/murano-api/:{{ container_config_directory }}/:ro" - "{{ kolla_dev_repos_directory ~ '/murano/murano:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/murano' if murano_dev_mode | bool else '' }}" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" murano_engine_default_volumes: - "{{ node_config_directory }}/murano-engine/:{{ container_config_directory }}/:ro" - "{{ kolla_dev_repos_directory ~ '/murano/murano:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/murano' if murano_dev_mode | bool else '' }}" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" murano_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/neutron/defaults/main.yml b/ansible/roles/neutron/defaults/main.yml index 990ef77969..a07fd4b23b 100644 --- a/ansible/roles/neutron/defaults/main.yml +++ b/ansible/roles/neutron/defaults/main.yml @@ -411,7 +411,7 @@ neutron_sriov_agent_healthcheck: neutron_dhcp_agent_default_volumes: - "{{ node_config_directory }}/neutron-dhcp-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "neutron_metadata_socket:/var/lib/neutron/kolla/" - "/run/netns:/run/netns:shared" - "kolla_logs:/var/log/kolla/" @@ -419,7 +419,7 @@ neutron_dhcp_agent_default_volumes: neutron_l3_agent_default_volumes: - "{{ node_config_directory }}/neutron-l3-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "neutron_metadata_socket:/var/lib/neutron/kolla/" - "/run/netns:/run/netns:shared" @@ -428,33 +428,33 @@ neutron_l3_agent_default_volumes: neutron_sriov_agent_default_volumes: - "{{ node_config_directory }}/neutron-sriov-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" neutron_mlnx_agent_default_volumes: - "{{ node_config_directory }}/neutron-mlnx-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" neutron_eswitchd_default_volumes: - "{{ node_config_directory }}/neutron-eswitchd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "/run/libvirt:/run/libvirt:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" neutron_linuxbridge_agent_default_volumes: - "{{ node_config_directory }}/neutron-linuxbridge-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" neutron_metadata_agent_default_volumes: - "{{ node_config_directory }}/neutron-metadata-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "neutron_metadata_socket:/var/lib/neutron/kolla/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" @@ -469,7 +469,7 @@ neutron_ovn_metadata_agent_default_volumes: neutron_openvswitch_agent_default_volumes: - "{{ node_config_directory }}/neutron-openvswitch-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run/openvswitch:/run/openvswitch:shared" - "kolla_logs:/var/log/kolla/" @@ -477,29 +477,29 @@ neutron_openvswitch_agent_default_volumes: neutron_server_default_volumes: - "{{ node_config_directory }}/neutron-server/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" neutron_bgp_dragent_default_volumes: - "{{ node_config_directory }}/neutron-bgp-dragent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" neutron_infoblox_ipam_agent_default_volumes: - "{{ node_config_directory }}/neutron-infoblox-ipam-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" neutron_metering_agent_default_volumes: - "{{ node_config_directory }}/neutron-metering-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/neutron/neutron:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/neutron' if neutron_dev_mode | bool else '' }}" ironic_neutron_agent_default_volumes: - "{{ node_config_directory }}/ironic-neutron-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" neutron_tls_proxy_default_volumes: - "{{ node_config_directory }}/neutron-tls-proxy/:{{ container_config_directory }}/:ro" diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index b28496e2fb..f763b84ece 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -35,7 +35,7 @@ interface_driver = linuxbridge {% if enable_nova_fake | bool %} ovs_integration_bridge = br-int-{{ item }} -host = {{ ansible_hostname }}_{{ item }} +host = {{ ansible_facts.hostname }}_{{ item }} {% endif %} allow_overlapping_ips = true diff --git a/ansible/roles/nova-cell/defaults/main.yml b/ansible/roles/nova-cell/defaults/main.yml index 18d6ddbce3..afbd995fdb 100644 --- a/ansible/roles/nova-cell/defaults/main.yml +++ b/ansible/roles/nova-cell/defaults/main.yml @@ -204,7 +204,7 @@ nova_tag: "{{ openstack_tag }}" nova_libvirt_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ nova_install_type }}-nova-libvirt" nova_libvirt_tag: "{{ nova_tag }}" nova_libvirt_image_full: "{{ nova_libvirt_image }}:{{ nova_libvirt_tag }}" -nova_libvirt_cpu_mode: "{{ 'host-passthrough' if ansible_architecture == 'aarch64' else '' }}" +nova_libvirt_cpu_mode: "{{ 'host-passthrough' if ansible_facts.architecture == 'aarch64' else '' }}" nova_ssh_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ nova_install_type }}-nova-ssh" nova_ssh_tag: "{{ nova_tag }}" @@ -324,7 +324,7 @@ nova_compute_ironic_healthcheck: nova_libvirt_default_volumes: - "{{ node_config_directory }}/nova-libvirt/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run/:/run/:shared" - "/dev:/dev" @@ -338,7 +338,7 @@ nova_libvirt_default_volumes: nova_ssh_default_volumes: - "{{ node_config_directory }}/nova-ssh/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla" - "{{ nova_instance_datadir_volume }}:/var/lib/nova" - "{% if enable_shared_var_lib_nova_mnt | bool %}/var/lib/nova/mnt:/var/lib/nova/mnt:shared{% endif %}" @@ -346,31 +346,31 @@ nova_ssh_default_volumes: nova_novncproxy_default_volumes: - "{{ node_config_directory }}/nova-novncproxy/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" nova_spicehtml5proxy_default_volumes: - "{{ node_config_directory }}/nova-spicehtml5proxy/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" nova_serialproxy_default_volumes: - "{{ node_config_directory }}/nova-serialproxy/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" nova_conductor_default_volumes: - "{{ node_config_directory }}/nova-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" nova_compute_default_volumes: - "{{ node_config_directory }}/nova-compute/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run:/run:shared" - "/dev:/dev" @@ -383,14 +383,14 @@ nova_compute_default_volumes: nova_compute_ironic_default_volumes: - "{{ node_config_directory }}/nova-compute-ironic/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" # Used by bootstrapping containers. nova_cell_bootstrap_default_volumes: - "{{ node_config_directory }}/nova-cell-bootstrap/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" @@ -500,7 +500,7 @@ libvirt_tls_manage_certs: true # When using tls we are verfiying the hostname we are connected to matches the # libvirt cert we are presented. As such we can't use IP's here, but keep the # ability for people to override the hostname to use. -migration_hostname: "{{ ansible_nodename }}" +migration_hostname: "{{ ansible_facts.nodename }}" # NOTE(yoctozepto): Part of bug #1681461 fix. # We can't get the id too effectively from the images so hardcoding here. diff --git a/ansible/roles/nova-cell/tasks/config-host.yml b/ansible/roles/nova-cell/tasks/config-host.yml index ca3a0a65ef..5b8d398df5 100644 --- a/ansible/roles/nova-cell/tasks/config-host.yml +++ b/ansible/roles/nova-cell/tasks/config-host.yml @@ -52,5 +52,5 @@ masked: true when: - nova_compute_virt_type == 'kvm' - - ansible_distribution == 'Ubuntu' + - ansible_facts.distribution == 'Ubuntu' - inventory_hostname in groups[nova_cell_compute_group] diff --git a/ansible/roles/nova-cell/tasks/discover_computes.yml b/ansible/roles/nova-cell/tasks/discover_computes.yml index be1309f538..1ee0e1c0ec 100644 --- a/ansible/roles/nova-cell/tasks/discover_computes.yml +++ b/ansible/roles/nova-cell/tasks/discover_computes.yml @@ -5,18 +5,18 @@ # Work with --limit by including only hosts in ansible_play_batch. - name: Build a list of expected compute service hosts vars: - # For virt, use ansible_nodename rather than inventory_hostname, since this + # For virt, use ansible_facts.nodename rather than inventory_hostname, since this # is similar to what nova uses internally as its default for the # [DEFAULT] host config option. virt_compute_service_hosts: >- {{ virt_computes_in_batch | - map('extract', hostvars, 'ansible_nodename') | + map('extract', hostvars, ['ansible_facts', 'nodename']) | list }} - # For ironic, use {{ansible_hostname}}-ironic since this is what we + # For ironic, use {{ansible_facts.hostname}}-ironic since this is what we # configure for [DEFAULT] host in nova.conf. ironic_compute_service_hosts: >- {{ ironic_computes_in_batch | - map('extract', hostvars, 'ansible_hostname') | + map('extract', hostvars, ['ansible_facts', 'hostname']) | map('regex_replace', '^(.*)$', '\1-ironic') | list }} set_fact: diff --git a/ansible/roles/nova-cell/templates/nova.conf.j2 b/ansible/roles/nova-cell/templates/nova.conf.j2 index 40199be7cf..8f29686f18 100644 --- a/ansible/roles/nova-cell/templates/nova.conf.j2 +++ b/ansible/roles/nova-cell/templates/nova.conf.j2 @@ -9,13 +9,13 @@ state_path = /var/lib/nova allow_resize_to_same_host = true {% if service_name == "nova-compute-ironic" %} -host={{ ansible_hostname }}-ironic +host={{ ansible_facts.hostname }}-ironic log_file = /var/log/kolla/nova/nova-compute-ironic.log compute_driver = ironic.IronicDriver ram_allocation_ratio = 1.0 reserved_host_memory_mb = 0 {% elif enable_nova_fake | bool %} -host = {{ ansible_hostname }}_{{ service_name }} +host = {{ ansible_facts.hostname }}_{{ service_name }} compute_driver = fake.FakeDriver {% elif nova_compute_virt_type == 'vmware' %} compute_driver = vmwareapi.VMwareVCDriver diff --git a/ansible/roles/nova/defaults/main.yml b/ansible/roles/nova/defaults/main.yml index dd15f220db..a98b0a41a6 100644 --- a/ansible/roles/nova/defaults/main.yml +++ b/ansible/roles/nova/defaults/main.yml @@ -138,27 +138,27 @@ nova_super_conductor_healthcheck: nova_api_default_volumes: - "{{ node_config_directory }}/nova-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" nova_scheduler_default_volumes: - "{{ node_config_directory }}/nova-scheduler/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" nova_super_conductor_default_volumes: - "{{ node_config_directory }}/nova-super-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" # Used by bootstrapping containers. nova_api_bootstrap_default_volumes: - "{{ node_config_directory }}/nova-api-bootstrap/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/nova/nova:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/nova' if nova_dev_mode | bool else '' }}" diff --git a/ansible/roles/octavia/defaults/main.yml b/ansible/roles/octavia/defaults/main.yml index cb63dd1560..3d5261962c 100644 --- a/ansible/roles/octavia/defaults/main.yml +++ b/ansible/roles/octavia/defaults/main.yml @@ -160,33 +160,33 @@ octavia_worker_healthcheck: octavia_api_default_volumes: - "{{ node_config_directory }}/octavia-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}" - "octavia_driver_agent:/var/run/octavia/" octavia_health_manager_default_volumes: - "{{ node_config_directory }}/octavia-health-manager/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}" octavia_driver_agent_default_volumes: - "{{ node_config_directory }}/octavia-driver-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}" - "octavia_driver_agent:/var/run/octavia/" octavia_housekeeping_default_volumes: - "{{ node_config_directory }}/octavia-housekeeping/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}" octavia_worker_default_volumes: - "{{ node_config_directory }}/octavia-worker/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}" diff --git a/ansible/roles/octavia/tasks/hm-interface.yml b/ansible/roles/octavia/tasks/hm-interface.yml index 9cbc8f188f..87ff409a91 100644 --- a/ansible/roles/octavia/tasks/hm-interface.yml +++ b/ansible/roles/octavia/tasks/hm-interface.yml @@ -12,11 +12,11 @@ network: "{{ octavia_amp_network['name'] }}" security_groups: "{{ octavia_amp_security_groups['health-mgr-sec-grp']['name'] }}" device_owner: 'Octavia:health-mgr' - name: "octavia-listen-port-{{ ansible_nodename }}" + name: "octavia-listen-port-{{ ansible_facts.nodename }}" register: port_info # ansible os_port module does not support 'host' parameter, but we need set the port's host -# value to {{ ansible_nodename }}, once os_port support this parameter, remove the task below +# value to {{ ansible_facts.nodename }}, once os_port support this parameter, remove the task below # https://docs.ansible.com/ansible/latest/modules/os_port_module.html#parameters - name: Update Octavia health manager port host_id become: True @@ -33,7 +33,7 @@ --os-username {{ octavia_user_auth.username }} --os-password {{ octavia_user_auth.password }} {% if openstack_cacert != '' %}--os-cacert {{ openstack_cacert }} {% endif %} - port set --host {{ ansible_nodename }} {{ port_id }} + port set --host {{ ansible_facts.nodename }} {{ port_id }} when: - port_info.changed diff --git a/ansible/roles/octavia/tasks/openrc.yml b/ansible/roles/octavia/tasks/openrc.yml index 19eee9693e..3e3286eae0 100644 --- a/ansible/roles/octavia/tasks/openrc.yml +++ b/ansible/roles/octavia/tasks/openrc.yml @@ -4,6 +4,6 @@ template: src: octavia-openrc.sh.j2 dest: "{{ node_config }}/octavia-openrc.sh" - owner: "{{ ansible_user_uid }}" - group: "{{ ansible_user_gid }}" + owner: "{{ ansible_facts.user_uid }}" + group: "{{ ansible_facts.user_gid }}" mode: 0600 diff --git a/ansible/roles/openvswitch/defaults/main.yml b/ansible/roles/openvswitch/defaults/main.yml index 9bdc13bf46..dce692f112 100644 --- a/ansible/roles/openvswitch/defaults/main.yml +++ b/ansible/roles/openvswitch/defaults/main.yml @@ -82,7 +82,7 @@ openvswitch_vswitchd_healthcheck: openvswitch_db_default_volumes: - "{{ node_config_directory }}/openvswitch-db-server/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run/openvswitch:/run/openvswitch:shared" - "kolla_logs:/var/log/kolla/" @@ -90,7 +90,7 @@ openvswitch_db_default_volumes: openvswitch_vswitchd_default_volumes: - "{{ node_config_directory }}/openvswitch-vswitchd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run/openvswitch:/run/openvswitch:shared" - "kolla_logs:/var/log/kolla/" @@ -103,4 +103,4 @@ openvswitch_vswitchd_extra_volumes: "{{ openvswitch_extra_volumes }}" # OpenvSwitch ############# -openvswitch_system_id: "{{ ansible_hostname }}" +openvswitch_system_id: "{{ ansible_facts.hostname }}" diff --git a/ansible/roles/ovs-dpdk/defaults/main.yml b/ansible/roles/ovs-dpdk/defaults/main.yml index 6948c558ac..439a5ae5c4 100644 --- a/ansible/roles/ovs-dpdk/defaults/main.yml +++ b/ansible/roles/ovs-dpdk/defaults/main.yml @@ -39,7 +39,7 @@ ovsdpdk_services: #################### ovs_bridge_mappings: "{% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}" ovs_port_mappings: "{% for bridge in neutron_bridge_name.split(',') %} {{ neutron_external_interface.split(',')[loop.index0] }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}" -tunnel_interface_network: "{{ hostvars[inventory_hostname]['ansible_' + dpdk_tunnel_interface]['ipv4']['network']}}/{{hostvars[inventory_hostname]['ansible_' + dpdk_tunnel_interface]['ipv4']['netmask'] }}" +tunnel_interface_network: "{{ hostvars[inventory_hostname].ansible_facts[dpdk_tunnel_interface]['ipv4']['network']}}/{{hostvars[inventory_hostname].ansible_facts[dpdk_tunnel_interface]['ipv4']['netmask'] }}" tunnel_interface_cidr: "{{ dpdk_tunnel_interface_address }}/{{ tunnel_interface_network | ipaddr('prefix') }}" ovs_cidr_mappings: "{% if neutron_bridge_name.split(',')|length != 1 %} {neutron_bridge_name.split(',')[0]}:{{ tunnel_interface_cidr }} {% else %} {{ neutron_bridge_name }}:{{ tunnel_interface_cidr }} {% endif %}" ovs_mem_channels: 4 @@ -76,14 +76,14 @@ ovsdpdk_vswitchd_dimensions: "{{ default_container_dimensions }}" ovsdpdk_db_default_volumes: - "{{ node_config_directory }}/ovsdpdk-db/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/run/openvswitch:/run/openvswitch:shared" - "kolla_logs:/var/log/kolla/" - "ovsdpdk_db:/var/lib/openvswitch/" ovsdpdk_vswitchd_default_volumes: - "{{ node_config_directory }}/ovsdpdk-vswitchd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/lib/modules:/lib/modules:ro" - "/run/openvswitch:/run/openvswitch:shared" - "/dev:/dev:shared" diff --git a/ansible/roles/panko/defaults/main.yml b/ansible/roles/panko/defaults/main.yml new file mode 100644 index 0000000000..21dea27b02 --- /dev/null +++ b/ansible/roles/panko/defaults/main.yml @@ -0,0 +1,79 @@ +--- +project_name: "panko" + +panko_services: + panko-api: + container_name: panko_api + group: panko-api + enabled: true + image: "{{ panko_api_image_full }}" + volumes: "{{ panko_api_default_volumes + panko_api_extra_volumes }}" + dimensions: "{{ panko_api_dimensions }}" + haproxy: + panko_api: + enabled: "{{ enable_panko }}" + mode: "http" + external: false + port: "{{ panko_api_port }}" + panko_api_external: + enabled: "{{ enable_panko }}" + mode: "http" + external: true + port: "{{ panko_api_port }}" + + +#################### +# Database +#################### +panko_database_name: "panko" +panko_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}panko{% endif %}" +panko_database_mysql_address: "{{ database_address | put_address_in_context('url') }}:{{ database_port }}" + +#################### +# Docker +#################### +panko_install_type: "{{ kolla_install_type }}" +panko_tag: "{{ openstack_tag }}" + +panko_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ panko_install_type }}-panko-api" +panko_api_tag: "{{ panko_tag }}" +panko_api_image_full: "{{ panko_api_image }}:{{ panko_api_tag }}" +panko_api_dimensions: "{{ default_container_dimensions }}" + +panko_api_default_volumes: + - "{{ node_config_directory }}/panko-api/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" + - "kolla_logs:/var/log/kolla/" +panko_api_extra_volumes: "{{ default_extra_volumes }}" + +#################### +# OpenStack +#################### +panko_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ panko_api_port }}" +panko_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ panko_api_port }}" +panko_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn | put_address_in_context('url') }}:{{ panko_api_port }}" + +panko_logging_debug: "{{ openstack_logging_debug }}" + +panko_keystone_user: "panko" + +openstack_panko_auth: "{{ openstack_auth }}" + +#################### +# Keystone +#################### +panko_ks_services: + - name: "panko" + type: "event" + description: "Panko Service" + endpoints: + - {'interface': 'admin', 'url': '{{ panko_admin_endpoint }}'} + - {'interface': 'internal', 'url': '{{ panko_internal_endpoint }}'} + - {'interface': 'public', 'url': '{{ panko_public_endpoint }}'} + +panko_ks_users: + - project: "service" + user: "{{ panko_keystone_user }}" + password: "{{ panko_keystone_password }}" + role: "admin" diff --git a/ansible/roles/placement/defaults/main.yml b/ansible/roles/placement/defaults/main.yml index 5a88570666..e6d5f9bce9 100644 --- a/ansible/roles/placement/defaults/main.yml +++ b/ansible/roles/placement/defaults/main.yml @@ -61,7 +61,7 @@ placement_api_healthcheck: placement_api_default_volumes: - "{{ node_config_directory }}/placement-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/placement/placement:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/placement' if placement_dev_mode | bool else '' }}" diff --git a/ansible/roles/prechecks/tasks/datetime_checks.yml b/ansible/roles/prechecks/tasks/datetime_checks.yml index a365ab2fe8..aea0aad0f6 100644 --- a/ansible/roles/prechecks/tasks/datetime_checks.yml +++ b/ansible/roles/prechecks/tasks/datetime_checks.yml @@ -23,4 +23,4 @@ /etc/timezone is not found. This file is used for system-wide timezone settings and Kolla Ansible needs this file for mounting it to containers. when: not etc_timezone.stat.exists - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' diff --git a/ansible/roles/prechecks/tasks/host_os_checks.yml b/ansible/roles/prechecks/tasks/host_os_checks.yml index 1d49932e3f..85f59d130e 100644 --- a/ansible/roles/prechecks/tasks/host_os_checks.yml +++ b/ansible/roles/prechecks/tasks/host_os_checks.yml @@ -2,18 +2,18 @@ - name: Checking host OS distribution fail: msg: >- - Host OS distribution {{ ansible_distribution }} is not supported. + Host OS distribution {{ ansible_facts.distribution }} is not supported. Supported distributions are: {{ host_os_distributions.keys() | join(', ') }} - when: ansible_distribution not in host_os_distributions + when: ansible_facts.distribution not in host_os_distributions - name: Checking host OS release or version fail: msg: >- - {{ ansible_distribution }} release {{ ansible_distribution_release }} - version {{ ansible_distribution_version }} is not supported. + {{ ansible_facts.distribution }} release {{ ansible_facts.distribution_release }} + version {{ ansible_facts.distribution_version }} is not supported. Supported releases are: - {{ host_os_distributions[ansible_distribution] | join(', ') }} + {{ host_os_distributions[ansible_facts.distribution] | join(', ') }} when: - - ansible_distribution_release not in host_os_distributions[ansible_distribution] - - ansible_distribution_version not in host_os_distributions[ansible_distribution] - - ansible_distribution_major_version not in host_os_distributions[ansible_distribution] + - ansible_facts.distribution_release not in host_os_distributions[ansible_facts.distribution] + - ansible_facts.distribution_version not in host_os_distributions[ansible_facts.distribution] + - ansible_facts.distribution_major_version not in host_os_distributions[ansible_facts.distribution] diff --git a/ansible/roles/prechecks/tasks/package_checks.yml b/ansible/roles/prechecks/tasks/package_checks.yml index a88e667f20..c86b40aef4 100644 --- a/ansible/roles/prechecks/tasks/package_checks.yml +++ b/ansible/roles/prechecks/tasks/package_checks.yml @@ -1,6 +1,6 @@ --- - name: Checking docker SDK version - command: "{{ ansible_python.executable }} -c \"import docker; print(docker.__version__)\"" + command: "{{ ansible_facts.python.executable }} -c \"import docker; print(docker.__version__)\"" register: result changed_when: false when: inventory_hostname in groups['baremetal'] diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 837b83d5e0..ea3e7d72f7 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -1,11 +1,11 @@ --- - name: Checking the api_interface is present fail: "msg='Please check the api_interface property - interface {{ api_interface }} not found'" - when: api_interface not in ansible_interfaces + when: api_interface not in ansible_facts.interfaces - name: Checking the api_interface is active fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not active'" - when: not hostvars[inventory_hostname]['ansible_' + api_interface]['active'] + when: not hostvars[inventory_hostname].ansible_facts[api_interface]['active'] # kolla_address handles relevant address check - name: Checking the api_interface ip address configuration diff --git a/ansible/roles/prechecks/vars/main.yml b/ansible/roles/prechecks/vars/main.yml index 16c60b8ba8..bcc8adfebe 100644 --- a/ansible/roles/prechecks/vars/main.yml +++ b/ansible/roles/prechecks/vars/main.yml @@ -4,9 +4,9 @@ docker_py_version_min: '3.4.1' ansible_version_min: '2.9' ansible_version_max: '2.10' -# Top level keys should match ansible_distribution. -# These map to lists of supported releases (ansible_distribution_release) or -# versions (ansible_distribution_version or ansible_distribution_major_version) +# Top level keys should match ansible_facts.distribution. +# These map to lists of supported releases (ansible_facts.distribution_release) or +# versions (ansible_facts.distribution_version or ansible_facts.distribution_major_version) # for that distribution. host_os_distributions: CentOS: diff --git a/ansible/roles/prometheus/defaults/main.yml b/ansible/roles/prometheus/defaults/main.yml index b1c1174609..d1ad085299 100644 --- a/ansible/roles/prometheus/defaults/main.yml +++ b/ansible/roles/prometheus/defaults/main.yml @@ -182,36 +182,36 @@ prometheus_blackbox_exporter_dimensions: "{{ default_container_dimensions }}" prometheus_server_default_volumes: - "{{ node_config_directory }}/prometheus-server/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ 'prometheus_v2' if not prometheus_use_v1 | bool else 'prometheus' }}:/var/lib/prometheus" - "kolla_logs:/var/log/kolla/" prometheus_haproxy_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-haproxy-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "haproxy_socket:/var/lib/kolla/haproxy" prometheus_mysqld_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-mysqld-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" prometheus_node_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-node-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "/proc:/host/proc:ro" - "/sys:/host/sys:ro" prometheus_memcached_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-memcached-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" prometheus_cadvisor_default_volumes: - "{{ node_config_directory }}/prometheus-cadvisor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "/:/rootfs:ro" - "/var/run:/var/run:rw" @@ -221,23 +221,23 @@ prometheus_cadvisor_default_volumes: prometheus_alertmanager_default_volumes: - "{{ node_config_directory }}/prometheus-alertmanager/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "prometheus:/var/lib/prometheus" prometheus_openstack_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-openstack-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" prometheus_elasticsearch_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-elasticsearch-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" prometheus_blackbox_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-blackbox-exporter/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" prometheus_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/qdrouterd/defaults/main.yml b/ansible/roles/qdrouterd/defaults/main.yml index 6c1d32217a..4dd2c12591 100644 --- a/ansible/roles/qdrouterd/defaults/main.yml +++ b/ansible/roles/qdrouterd/defaults/main.yml @@ -37,7 +37,7 @@ qdrouterd_healthcheck: qdrouterd_default_volumes: - "{{ node_config_directory }}/qdrouterd/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "qdrouterd:/var/lib/qdrouterd/" - "kolla_logs:/var/log/kolla/" qdrouterd_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/qdrouterd/tasks/precheck.yml b/ansible/roles/qdrouterd/tasks/precheck.yml index c01ad703ff..53f98d6bcf 100644 --- a/ansible/roles/qdrouterd/tasks/precheck.yml +++ b/ansible/roles/qdrouterd/tasks/precheck.yml @@ -26,7 +26,7 @@ - name: Check if all qdrouterd hostnames are resolvable vars: nss_database: "{{ 'ahostsv4' if api_address_family == 'ipv4' else 'ahostsv6' }}" - command: "getent {{ nss_database }} {{ hostvars[item]['ansible_hostname'] }}" + command: "getent {{ nss_database }} {{ hostvars[item].ansible_facts.hostname }}" changed_when: false register: qdrouterd_hostnames with_items: "{{ groups['qdrouterd'] }}" diff --git a/ansible/roles/rabbitmq/defaults/main.yml b/ansible/roles/rabbitmq/defaults/main.yml index 09c734a078..8f26c353b1 100644 --- a/ansible/roles/rabbitmq/defaults/main.yml +++ b/ansible/roles/rabbitmq/defaults/main.yml @@ -73,7 +73,7 @@ rabbitmq_healthcheck: rabbitmq_default_volumes: - "{{ node_config_directory }}/{{ project_name }}/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ project_name }}:/var/lib/rabbitmq/" - "kolla_logs:/var/log/kolla/" rabbitmq_extra_volumes: "{{ default_extra_volumes }}" @@ -83,7 +83,7 @@ rabbitmq_extra_volumes: "{{ default_extra_volumes }}" #################### rabbitmq_user: "openstack" rabbitmq_cluster_name: "openstack" -rabbitmq_hostname: "{{ ansible_hostname }}" +rabbitmq_hostname: "{{ ansible_facts.hostname }}" rabbitmq_pid_file: "/var/lib/rabbitmq/mnesia/rabbitmq.pid" rabbitmq_server_additional_erl_args: "+S 2:2 +sbwt none" # Dict of TLS options for RabbitMQ. Keys will be prefixed with 'ssl_options.'. diff --git a/ansible/roles/rabbitmq/tasks/precheck.yml b/ansible/roles/rabbitmq/tasks/precheck.yml index 3dc37bc88f..19e50de418 100644 --- a/ansible/roles/rabbitmq/tasks/precheck.yml +++ b/ansible/roles/rabbitmq/tasks/precheck.yml @@ -60,7 +60,7 @@ - name: Check if all rabbit hostnames are resolvable vars: nss_database: "{{ 'ahostsv4' if api_address_family == 'ipv4' else 'ahostsv6' }}" - command: "getent {{ nss_database }} {{ hostvars[item]['ansible_hostname'] }}" + command: "getent {{ nss_database }} {{ hostvars[item].ansible_facts.hostname }}" changed_when: false register: rabbitmq_hostnames with_items: "{{ groups['rabbitmq'] }}" @@ -147,7 +147,7 @@ - name: Check if all outward rabbit hostnames are resolvable vars: nss_database: "{{ 'ahostsv4' if api_address_family == 'ipv4' else 'ahostsv6' }}" - command: "getent {{ nss_database }} {{ hostvars[item]['ansible_hostname'] }}" + command: "getent {{ nss_database }} {{ hostvars[item].ansible_facts.hostname }}" changed_when: false register: outward_rabbitmq_hostnames with_items: "{{ groups['outward-rabbitmq'] }}" diff --git a/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 b/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 index 28fd9043be..90d0561c0f 100644 --- a/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 +++ b/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 @@ -1,4 +1,4 @@ -RABBITMQ_NODENAME=rabbit@{{ ansible_hostname }} +RABBITMQ_NODENAME=rabbit@{{ ansible_facts.hostname }} RABBITMQ_LOG_BASE=/var/log/kolla/{{ project_name }} RABBITMQ_DIST_PORT={{ role_rabbitmq_cluster_port }} RABBITMQ_PID_FILE={{ rabbitmq_pid_file }} diff --git a/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 b/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 index c7c46cd338..7ceafa2f59 100644 --- a/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 +++ b/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 @@ -14,7 +14,7 @@ management.load_definitions = /etc/rabbitmq/definitions.json cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config {% for host in groups[role_rabbitmq_groups] %} -cluster_formation.classic_config.nodes.{{ loop.index0 }} = rabbit@{{ hostvars[host]['ansible_hostname'] }} +cluster_formation.classic_config.nodes.{{ loop.index0 }} = rabbit@{{ hostvars[host].ansible_facts.hostname }} {% endfor %} {% if rabbitmq_enable_tls | bool %} diff --git a/ansible/roles/rally/defaults/main.yml b/ansible/roles/rally/defaults/main.yml new file mode 100644 index 0000000000..571abf19be --- /dev/null +++ b/ansible/roles/rally/defaults/main.yml @@ -0,0 +1,36 @@ +--- +project_name: "rally" + +rally_services: + rally: + container_name: "rally" + image: "{{ rally_image_full }}" + enabled: true + group: "rally" + volumes: "{{ rally_default_volumes + rally_extra_volumes }}" + dimensions: "{{ rally_dimensions }}" + + +######## +# Docker +######## +rally_install_type: "{{ kolla_install_type }}" +rally_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ rally_install_type }}-rally" +rally_tag: "{{ openstack_tag }}" +rally_image_full: "{{ rally_image }}:{{ rally_tag }}" +rally_dimensions: "{{ default_container_dimensions }}" + +rally_default_volumes: + - "{{ node_config_directory }}/rally/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" + - "kolla_logs:/var/log/kolla/" + +rally_extra_volumes: "{{ default_extra_volumes }}" + +#################### +# Database +#################### +rally_database_name: "rally" +rally_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}rally{% endif %}" +rally_database_address: "{{ database_address | put_address_in_context('url') }}:{{ database_port }}" diff --git a/ansible/roles/redis/defaults/main.yml b/ansible/roles/redis/defaults/main.yml index b9a29b0776..9769b495a9 100644 --- a/ansible/roles/redis/defaults/main.yml +++ b/ansible/roles/redis/defaults/main.yml @@ -62,13 +62,13 @@ redis_sentinel_healthcheck: redis_default_volumes: - "{{ node_config_directory }}/redis/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ project_name }}:/var/lib/redis/" - "kolla_logs:/var/log/kolla/" redis_sentinel_default_volumes: - "{{ node_config_directory }}/redis-sentinel/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" redis_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/sahara/defaults/main.yml b/ansible/roles/sahara/defaults/main.yml index df1a235182..8a5f208426 100644 --- a/ansible/roles/sahara/defaults/main.yml +++ b/ansible/roles/sahara/defaults/main.yml @@ -86,14 +86,14 @@ sahara_engine_healthcheck: sahara_api_default_volumes: - "{{ node_config_directory }}/sahara-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "sahara:/var/lib/sahara/" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/sahara/sahara:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/sahara' if sahara_dev_mode | bool else '' }}" sahara_engine_default_volumes: - "{{ node_config_directory }}/sahara-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "sahara:/var/lib/sahara/" - "kolla_logs:/var/log/kolla/" - "/run:/run:shared" diff --git a/ansible/roles/senlin/defaults/main.yml b/ansible/roles/senlin/defaults/main.yml index 7ef7dcb083..7db54276b3 100644 --- a/ansible/roles/senlin/defaults/main.yml +++ b/ansible/roles/senlin/defaults/main.yml @@ -138,25 +138,25 @@ senlin_health_manager_healthcheck: senlin_api_default_volumes: - "{{ node_config_directory }}/senlin-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/senlin/senlin:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/senlin' if senlin_dev_mode | bool else '' }}" senlin_conductor_default_volumes: - "{{ node_config_directory }}/senlin-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/senlin/senlin:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/senlin' if senlin_dev_mode | bool else '' }}" senlin_engine_default_volumes: - "{{ node_config_directory }}/senlin-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/senlin/senlin:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/senlin' if senlin_dev_mode | bool else '' }}" senlin_health_manager_default_volumes: - "{{ node_config_directory }}/senlin-health-manager/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/senlin/senlin:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/senlin' if senlin_dev_mode | bool else '' }}" diff --git a/ansible/roles/skydive/defaults/main.yml b/ansible/roles/skydive/defaults/main.yml index 97e9dd2c08..b2ac934499 100644 --- a/ansible/roles/skydive/defaults/main.yml +++ b/ansible/roles/skydive/defaults/main.yml @@ -77,12 +77,12 @@ skydive_agent_healthcheck: skydive_analyzer_default_volumes: - "{{ node_config_directory }}/skydive-analyzer/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" skydive_agent_default_volumes: - "{{ node_config_directory }}/skydive-agent/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "/var/run/openvswitch:/var/run/openvswitch:ro" - "/var/run/netns:/host/run:shared" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/skydive/templates/skydive-analyzer.conf.j2 b/ansible/roles/skydive/templates/skydive-analyzer.conf.j2 index f3035b6ce3..549bafff22 100644 --- a/ansible/roles/skydive/templates/skydive-analyzer.conf.j2 +++ b/ansible/roles/skydive/templates/skydive-analyzer.conf.j2 @@ -51,7 +51,7 @@ analyzer: {% set interfaces_loop = loop %} {% for host in groups['skydive-agent'] %} - TOR{{ interfaces_loop.index }}[Name=tor{{ interfaces_loop.index }}] -> TOR{{ interfaces_loop.index }}_PORT{{ loop.index }}[Name=port{{ loop.index }}, MTU=1500] - - TOR{{ interfaces_loop.index }}_PORT{{ loop.index }} -> *[Type=host,Name={{ hostvars[host]['ansible_hostname'] }}]/{{ interface }} + - TOR{{ interfaces_loop.index }}_PORT{{ loop.index }} -> *[Type=host,Name={{ hostvars[host].ansible_facts.hostname }}]/{{ interface }} {% endfor %} {% endfor %} {% endif %} diff --git a/ansible/roles/solum/defaults/main.yml b/ansible/roles/solum/defaults/main.yml index ff72ced638..e5b878e514 100644 --- a/ansible/roles/solum/defaults/main.yml +++ b/ansible/roles/solum/defaults/main.yml @@ -94,25 +94,25 @@ solum_conductor_dimensions: "{{ default_container_dimensions }}" solum_api_default_volumes: - "{{ node_config_directory }}/solum-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/solum' if solum_dev_mode | bool else '' }}" solum_worker_default_volumes: - "{{ node_config_directory }}/solum-worker/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/solum' if solum_dev_mode | bool else '' }}" solum_deployer_default_volumes: - "{{ node_config_directory }}/solum-deployer/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/solum' if solum_dev_mode | bool else '' }}" solum_conductor_default_volumes: - "{{ node_config_directory }}/solum-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/solum' if solum_dev_mode | bool else '' }}" diff --git a/ansible/roles/solum/templates/solum.conf.j2 b/ansible/roles/solum/templates/solum.conf.j2 index 9af1c31501..60eec43e65 100644 --- a/ansible/roles/solum/templates/solum.conf.j2 +++ b/ansible/roles/solum/templates/solum.conf.j2 @@ -39,7 +39,7 @@ lp_operator_user = {{ solum_keystone_user }} [builder] port = {{ solum_image_builder_public_endpoint }} -host = {{ ansible_hostname }}_{{ item }} +host = {{ ansible_facts.hostname }}_{{ item }} [database] connection = mysql+pymysql://{{ solum_database_user }}:{{ solum_database_password }}@{{ solum_database_address }}/{{ solum_database_name }} diff --git a/ansible/roles/storm/defaults/main.yml b/ansible/roles/storm/defaults/main.yml index f343af3d8d..39660c29ac 100644 --- a/ansible/roles/storm/defaults/main.yml +++ b/ansible/roles/storm/defaults/main.yml @@ -43,13 +43,13 @@ storm_nimbus_dimensions: "{{ default_container_dimensions }}" storm_worker_default_volumes: - "{{ node_config_directory }}/storm-worker/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "storm:/var/lib/storm/data" - "kolla_logs:/var/log/kolla/" storm_nimbus_default_volumes: - "{{ node_config_directory }}/storm-nimbus/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "storm:/var/lib/storm/data" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/tacker/defaults/main.yml b/ansible/roles/tacker/defaults/main.yml index 8df763f397..3624d53788 100644 --- a/ansible/roles/tacker/defaults/main.yml +++ b/ansible/roles/tacker/defaults/main.yml @@ -88,7 +88,7 @@ tacker_server_default_volumes: - "{{ node_config_directory }}/tacker-server/:{{ container_config_directory }}/:ro" - "{{ kolla_dev_repos_directory ~ '/tacker/tacker:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/tacker' if tacker_dev_mode | bool else '' }}" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" # NOTE(yoctozepto): Starting in Train, this volume must be shared # between all instances of both Tacker services (Server, Conductor) @@ -97,7 +97,7 @@ tacker_conductor_default_volumes: - "{{ node_config_directory }}/tacker-conductor/:{{ container_config_directory }}/:ro" - "{{ kolla_dev_repos_directory ~ '/tacker/tacker:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/tacker' if tacker_dev_mode | bool else '' }}" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "kolla_tacker_vnfpackages:/var/lib/tacker/vnfpackages/" # NOTE(yoctozepto): Starting in Train, this volume must be shared @@ -164,4 +164,4 @@ tacker_ks_users: #################### # HAProxy #################### -tacker_haproxy_members: "{% for host in tacker_hosts %}server {{ hostvars[host]['ansible_hostname'] }} {{ 'api' | kolla_address(host) }}:{{ tacker_server_port }} check inter 2000 rise 2 fall 5;{% endfor %}" +tacker_haproxy_members: "{% for host in tacker_hosts %}server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ tacker_server_port }} check inter 2000 rise 2 fall 5;{% endfor %}" diff --git a/ansible/roles/telegraf/defaults/main.yml b/ansible/roles/telegraf/defaults/main.yml index 4eb8c48e54..23caaf1912 100644 --- a/ansible/roles/telegraf/defaults/main.yml +++ b/ansible/roles/telegraf/defaults/main.yml @@ -23,7 +23,7 @@ telegraf_dimensions: "{{ default_container_dimensions }}" telegraf_default_volumes: - "{{ node_config_directory }}/telegraf/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "/sys:/rootfs/sys:ro" - "/proc:/rootfs/proc:ro" diff --git a/ansible/roles/tempest/defaults/main.yml b/ansible/roles/tempest/defaults/main.yml index e3ee3f6da1..3f1c8ca624 100644 --- a/ansible/roles/tempest/defaults/main.yml +++ b/ansible/roles/tempest/defaults/main.yml @@ -23,7 +23,7 @@ tempest_dimensions: "{{ default_container_dimensions }}" tempest_default_volumes: - "{{ node_config_directory }}/tempest/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" tempest_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/trove/defaults/main.yml b/ansible/roles/trove/defaults/main.yml index a7ee7eaca0..bf6b20ede5 100644 --- a/ansible/roles/trove/defaults/main.yml +++ b/ansible/roles/trove/defaults/main.yml @@ -111,21 +111,21 @@ trove_taskmanager_healthcheck: trove_api_default_volumes: - "{{ node_config_directory }}/trove-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/trove/trove:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/trove' if trove_dev_mode | bool else '' }}" - "trove:/var/lib/trove/" trove_conductor_default_volumes: - "{{ node_config_directory }}/trove-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/trove/trove:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/trove' if trove_dev_mode | bool else '' }}" - "trove:/var/lib/trove/" trove_taskmanager_default_volumes: - "{{ node_config_directory }}/trove-taskmanager/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/trove/trove:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/trove' if trove_dev_mode | bool else '' }}" - "trove:/var/lib/trove/" diff --git a/ansible/roles/vitrage/defaults/main.yml b/ansible/roles/vitrage/defaults/main.yml index 9f39f5b2a0..bd64c9b892 100644 --- a/ansible/roles/vitrage/defaults/main.yml +++ b/ansible/roles/vitrage/defaults/main.yml @@ -162,31 +162,31 @@ vitrage_persistor_healthcheck: vitrage_api_default_volumes: - "{{ node_config_directory }}/vitrage-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" vitrage_notifier_default_volumes: - "{{ node_config_directory }}/vitrage-notifier/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" vitrage_graph_default_volumes: - "{{ node_config_directory }}/vitrage-graph/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" vitrage_ml_default_volumes: - "{{ node_config_directory }}/vitrage-ml/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" vitrage_persistor_default_volumes: - "{{ node_config_directory }}/vitrage-persistor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/vmtp/defaults/main.yml b/ansible/roles/vmtp/defaults/main.yml index d3589e1640..122da92d1d 100644 --- a/ansible/roles/vmtp/defaults/main.yml +++ b/ansible/roles/vmtp/defaults/main.yml @@ -22,7 +22,7 @@ vmtp_dimensions: "{{ default_container_dimensions }}" vmtp_default_volumes: - "{{ node_config_directory }}/vmtp/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" vmtp_extra_volumes: "{{ default_extra_volumes }}" diff --git a/ansible/roles/watcher/defaults/main.yml b/ansible/roles/watcher/defaults/main.yml index 08a2c3a44f..6872690122 100644 --- a/ansible/roles/watcher/defaults/main.yml +++ b/ansible/roles/watcher/defaults/main.yml @@ -111,19 +111,19 @@ watcher_engine_healthcheck: watcher_api_default_volumes: - "{{ node_config_directory }}/watcher-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/watcher/watcher:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/watcher' if watcher_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" watcher_applier_default_volumes: - "{{ node_config_directory }}/watcher-applier/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/watcher/watcher:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/watcher' if watcher_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" watcher_engine_default_volumes: - "{{ node_config_directory }}/watcher-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/watcher/watcher:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/watcher' if watcher_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/zookeeper/defaults/main.yml b/ansible/roles/zookeeper/defaults/main.yml index e4b50f7304..5ab18e7331 100644 --- a/ansible/roles/zookeeper/defaults/main.yml +++ b/ansible/roles/zookeeper/defaults/main.yml @@ -30,7 +30,7 @@ zookeeper_dimensions: "{{ default_container_dimensions }}" zookeeper_default_volumes: - "{{ node_config_directory }}/zookeeper/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "zookeeper:/var/lib/zookeeper/data" - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/zookeeper/templates/myid.j2 b/ansible/roles/zookeeper/templates/myid.j2 index 4492f393cb..7013873cce 100644 --- a/ansible/roles/zookeeper/templates/myid.j2 +++ b/ansible/roles/zookeeper/templates/myid.j2 @@ -1,5 +1,5 @@ {% for host in groups['zookeeper'] -%} -{% if hostvars[host]['ansible_hostname'] == ansible_hostname -%} +{% if hostvars[host].ansible_facts.hostname == ansible_facts.hostname -%} {{ loop.index }} {%- endif %} {%- endfor %} diff --git a/ansible/roles/zun/defaults/main.yml b/ansible/roles/zun/defaults/main.yml index 62643039b5..6fe49c5d8f 100644 --- a/ansible/roles/zun/defaults/main.yml +++ b/ansible/roles/zun/defaults/main.yml @@ -94,19 +94,19 @@ zun_cni_daemon_dimensions: "{{ default_container_dimensions }}" zun_api_default_volumes: - "{{ node_config_directory }}/zun-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/zun' if zun_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" zun_wsproxy_default_volumes: - "{{ node_config_directory }}/zun-wsproxy/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/zun' if zun_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" zun_compute_default_volumes: - "{{ node_config_directory }}/zun-compute/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/zun' if zun_dev_mode | bool else '' }}" - "/run:/run:shared" @@ -118,7 +118,7 @@ zun_compute_default_volumes: zun_cni_daemon_default_volumes: - "{{ node_config_directory }}/zun-cni-daemon/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_os_family == 'Debian' else '' }}" + - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - "kolla_logs:/var/log/kolla/" - "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/zun' if zun_dev_mode | bool else '' }}" diff --git a/doc/source/user/ansible-tuning.rst b/doc/source/user/ansible-tuning.rst index 9a863ec6d8..a9f50e6210 100644 --- a/doc/source/user/ansible-tuning.rst +++ b/doc/source/user/ansible-tuning.rst @@ -64,3 +64,22 @@ the `jsonfile cache plugin You may also wish to set the expiration timeout for the cache via ``[defaults] fact_caching_timeout``. + +Fact variable injection +----------------------- + +By default, Ansible injects a variable for every fact, prefixed with +``ansible_``. This can result in a large number of variables for each host, +which at scale can incur a performance penalty. Ansible provides a +`configuration option +`__ +that can be set to ``False`` to prevent this injection of facts. In this case, +facts should be referenced via ``ansible_facts.``. In recent releases of +Kolla Ansible, facts are referenced via ``ansible_facts``, allowing users to +disable fact variable injection. + +.. code-block:: ini + :caption: ``ansible.cfg`` + + [defaults] + inject_facts_as_vars = False diff --git a/kolla_ansible/kolla_address.py b/kolla_ansible/kolla_address.py index 888ee734c2..f40b59f6a5 100644 --- a/kolla_ansible/kolla_address.py +++ b/kolla_ansible/kolla_address.py @@ -82,7 +82,7 @@ def kolla_address(context, network_name, hostname=None): network_name=network_name)) ansible_interface_name = interface_name.replace('-', '_') - interface = host.get('ansible_' + ansible_interface_name) + interface = host['ansible_facts'].get(ansible_interface_name) if interface is None: raise FilterError("Interface '{interface_name}' " "not present " diff --git a/kolla_ansible/tests/unit/test_address_filters.py b/kolla_ansible/tests/unit/test_address_filters.py index 43bfc568a8..338afb1301 100644 --- a/kolla_ansible/tests/unit/test_address_filters.py +++ b/kolla_ansible/tests/unit/test_address_filters.py @@ -84,9 +84,11 @@ class TestKollaAddressFilter(unittest.TestCase): 'primary': { 'api_address_family': 'ipv4', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv4': { - 'address': addr, + 'ansible_facts': { + 'fake_interface': { + 'ipv4': { + 'address': addr, + }, }, }, }, @@ -103,14 +105,16 @@ class TestKollaAddressFilter(unittest.TestCase): 'enable_haproxy': 'yes', 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr, - 'scope': 'global', - 'prefix': 64, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr, + 'scope': 'global', + 'prefix': 64, + }, + ], + }, }, }, }, @@ -124,7 +128,9 @@ class TestKollaAddressFilter(unittest.TestCase): 'primary': { 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { + 'ansible_facts': { + 'fake_interface': { + }, }, }, }, @@ -140,24 +146,26 @@ class TestKollaAddressFilter(unittest.TestCase): 'enable_haproxy': 'yes', 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr, - 'scope': 'global', - 'prefix': 64, - }, - { - 'address': addr + '1', - 'scope': 'link', - 'prefix': 64, - }, - { - 'address': addr + '2', - 'scope': 'global', - 'prefix': 64, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr, + 'scope': 'global', + 'prefix': 64, + }, + { + 'address': addr + '1', + 'scope': 'link', + 'prefix': 64, + }, + { + 'address': addr + '2', + 'scope': 'global', + 'prefix': 64, + }, + ], + }, }, }, }, @@ -172,19 +180,21 @@ class TestKollaAddressFilter(unittest.TestCase): 'primary': { 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr, - 'scope': 'link', - 'prefix': 64, - }, - { - 'address': addr + '1', - 'scope': 'link', - 'prefix': 64, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr, + 'scope': 'link', + 'prefix': 64, + }, + { + 'address': addr + '1', + 'scope': 'link', + 'prefix': 64, + }, + ], + }, }, }, }, @@ -200,14 +210,16 @@ class TestKollaAddressFilter(unittest.TestCase): 'enable_haproxy': 'yes', 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr, - 'scope': 'global', - 'prefix': 128, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr, + 'scope': 'global', + 'prefix': 128, + }, + ], + }, }, }, }, @@ -224,19 +236,21 @@ class TestKollaAddressFilter(unittest.TestCase): 'kolla_internal_vip_address': addr + '1', 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr + '1', - 'scope': 'global', - 'prefix': 128, - }, - { - 'address': addr, - 'scope': 'global', - 'prefix': 128, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr + '1', + 'scope': 'global', + 'prefix': 128, + }, + { + 'address': addr, + 'scope': 'global', + 'prefix': 128, + }, + ], + }, }, }, }, @@ -253,19 +267,21 @@ class TestKollaAddressFilter(unittest.TestCase): 'kolla_external_vip_address': addr + '1', 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr + '1', - 'scope': 'global', - 'prefix': 128, - }, - { - 'address': addr, - 'scope': 'global', - 'prefix': 128, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr + '1', + 'scope': 'global', + 'prefix': 128, + }, + { + 'address': addr, + 'scope': 'global', + 'prefix': 128, + }, + ], + }, }, }, }, @@ -283,14 +299,16 @@ class TestKollaAddressFilter(unittest.TestCase): 'kolla_internal_vip_address': addr, 'api_address_family': 'ipv6', 'api_interface': 'fake-interface', - 'ansible_fake_interface': { - 'ipv6': [ - { - 'address': addr, - 'scope': 'global', - 'prefix': 128, - }, - ], + 'ansible_facts': { + 'fake_interface': { + 'ipv6': [ + { + 'address': addr, + 'scope': 'global', + 'prefix': 128, + }, + ], + }, }, }, }, diff --git a/releasenotes/notes/ansible-facts-4279741e84c03ce0.yaml b/releasenotes/notes/ansible-facts-4279741e84c03ce0.yaml new file mode 100644 index 0000000000..3e6a5a19c8 --- /dev/null +++ b/releasenotes/notes/ansible-facts-4279741e84c03ce0.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - | + Updates all references to Ansible facts within Kolla Ansible from using + individual fact variables to using the items in the ``ansible_facts`` + dictionary. This allows users to disable `fact variable injection + + __ in their Ansible configuration, which may provide some performance + improvement. Check for facts referenced in local configuration files, and + update to use ``ansible_facts`` before disabling fact variable injection. diff --git a/tests/templates/ansible.cfg.j2 b/tests/templates/ansible.cfg.j2 index 29147b9ad9..54f74ca5bf 100644 --- a/tests/templates/ansible.cfg.j2 +++ b/tests/templates/ansible.cfg.j2 @@ -1,6 +1,12 @@ [defaults] callback_plugins = {{ ara_callback_plugins.stdout }} host_key_checking = False +# TODO(mgoddard): Add inject_facts_as_vars unconditionally when previous +# release is xena or previous release has had this patch backported. +{% if not is_upgrade or previous_release not in ["victoria", "wallaby"] %} +# Ensure that facts are referenced via ansible_facts.. +inject_facts_as_vars = False +{% endif %} [ssh_connection] pipelining = True