Auto-fix usage of modules via FQCN
Since ansible-core 2.10 it is recommended to use modules via FQCN In order to align with recommendation, we perform migration by applying suggestions made by `ansible-lint --fix=fqcn` Change-Id: I3106f13014a3f99cefcd07ccf31a0c79f2977805
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Restart octavia services
|
- name: Restart octavia services
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ item.service_name }}"
|
name: "{{ item.service_name }}"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
with_items: "{{ filtered_octavia_services }}"
|
with_items: "{{ filtered_octavia_services }}"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Fail if service was deployed using a different installation method
|
- name: Fail if service was deployed using a different installation method
|
||||||
fail:
|
ansible.builtin.fail:
|
||||||
msg: "Switching installation methods for OpenStack services is not supported"
|
msg: "Switching installation methods for OpenStack services is not supported"
|
||||||
when:
|
when:
|
||||||
- ansible_local is defined
|
- ansible_local is defined
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
- ansible_local.openstack_ansible.octavia.install_method != octavia_install_method
|
- ansible_local.openstack_ansible.octavia.install_method != octavia_install_method
|
||||||
|
|
||||||
- name: Gather variables for each operating system
|
- name: Gather variables for each operating system
|
||||||
include_vars: "{{ lookup('first_found', params) }}"
|
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||||
vars:
|
vars:
|
||||||
params:
|
params:
|
||||||
files:
|
files:
|
||||||
@@ -39,12 +39,12 @@
|
|||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Gather variables for installation method
|
- name: Gather variables for installation method
|
||||||
include_vars: "{{ octavia_install_method }}_install.yml"
|
ansible.builtin.include_vars: "{{ octavia_install_method }}_install.yml"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Fail if our required secrets are not present
|
- name: Fail if our required secrets are not present
|
||||||
fail:
|
ansible.builtin.fail:
|
||||||
msg: "Please set the {{ item }} variable prior to applying this role."
|
msg: "Please set the {{ item }} variable prior to applying this role."
|
||||||
when: (item is undefined) or (item is none)
|
when: (item is undefined) or (item is none)
|
||||||
with_items: "{{ octavia_required_secrets }}"
|
with_items: "{{ octavia_required_secrets }}"
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Including osa.db_setup role
|
- name: Including osa.db_setup role
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: openstack.osa.db_setup
|
name: openstack.osa.db_setup
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Including osa.mq_setup role
|
- name: Including osa.mq_setup role
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: openstack.osa.mq_setup
|
name: openstack.osa.mq_setup
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
@@ -105,17 +105,17 @@
|
|||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Gather variables for installation method
|
- name: Gather variables for installation method
|
||||||
include_vars: "{{ octavia_install_method }}_install.yml"
|
ansible.builtin.include_vars: "{{ octavia_install_method }}_install.yml"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Importing octavia_pre_install tasks
|
- name: Importing octavia_pre_install tasks
|
||||||
import_tasks: octavia_pre_install.yml
|
ansible.builtin.import_tasks: octavia_pre_install.yml
|
||||||
tags:
|
tags:
|
||||||
- octavia-install
|
- octavia-install
|
||||||
|
|
||||||
- name: Create and install SSL certificates
|
- name: Create and install SSL certificates
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: pki
|
name: pki
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Assemble SSL certificates
|
- name: Assemble SSL certificates
|
||||||
assemble:
|
ansible.builtin.assemble:
|
||||||
src: /etc/octavia/certs/
|
src: /etc/octavia/certs/
|
||||||
dest: /etc/octavia/certs/client.pem
|
dest: /etc/octavia/certs/client.pem
|
||||||
regexp: "(client\\.pem\\.crt|client\\.pem\\.key)$"
|
regexp: "(client\\.pem\\.crt|client\\.pem\\.key)$"
|
||||||
@@ -154,12 +154,12 @@
|
|||||||
- octavia-install
|
- octavia-install
|
||||||
|
|
||||||
- name: Importing octavia_install tasks
|
- name: Importing octavia_install tasks
|
||||||
import_tasks: octavia_install.yml
|
ansible.builtin.import_tasks: octavia_install.yml
|
||||||
tags:
|
tags:
|
||||||
- octavia-install
|
- octavia-install
|
||||||
|
|
||||||
- name: Import uwsgi role
|
- name: Import uwsgi role
|
||||||
import_role:
|
ansible.builtin.import_role:
|
||||||
name: uwsgi
|
name: uwsgi
|
||||||
vars:
|
vars:
|
||||||
uwsgi_services: "{{ uwsgi_octavia_services }}"
|
uwsgi_services: "{{ uwsgi_octavia_services }}"
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
- uwsgi
|
- uwsgi
|
||||||
|
|
||||||
- name: Run the systemd service role
|
- name: Run the systemd service role
|
||||||
import_role:
|
ansible.builtin.import_role:
|
||||||
name: systemd_service
|
name: systemd_service
|
||||||
vars:
|
vars:
|
||||||
systemd_after_targets: "{{ service_var.after_targets | default(['syslog.target', 'network.target']) }}"
|
systemd_after_targets: "{{ service_var.after_targets | default(['syslog.target', 'network.target']) }}"
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
- systemd-service
|
- systemd-service
|
||||||
|
|
||||||
- name: Including osa.service_setup role
|
- name: Including osa.service_setup role
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: openstack.osa.service_setup
|
name: openstack.osa.service_setup
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
@@ -229,7 +229,7 @@
|
|||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Including octavia_resources tasks
|
- name: Including octavia_resources tasks
|
||||||
include_tasks: octavia_resources.yml
|
ansible.builtin.include_tasks: octavia_resources.yml
|
||||||
args:
|
args:
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
@@ -242,25 +242,25 @@
|
|||||||
- octavia-resources
|
- octavia-resources
|
||||||
|
|
||||||
- name: Importing octavia_post_install tasks
|
- name: Importing octavia_post_install tasks
|
||||||
import_tasks: octavia_post_install.yml
|
ansible.builtin.import_tasks: octavia_post_install.yml
|
||||||
tags:
|
tags:
|
||||||
- octavia-install
|
- octavia-install
|
||||||
- octavia-config
|
- octavia-config
|
||||||
- post-install
|
- post-install
|
||||||
|
|
||||||
- name: Importing octavia_db_sync tasks
|
- name: Importing octavia_db_sync tasks
|
||||||
import_tasks: octavia_db_sync.yml
|
ansible.builtin.import_tasks: octavia_db_sync.yml
|
||||||
when:
|
when:
|
||||||
- _octavia_is_first_play_host
|
- _octavia_is_first_play_host
|
||||||
tags:
|
tags:
|
||||||
- octavia-install
|
- octavia-install
|
||||||
|
|
||||||
- name: Importing octavia_policy tasks
|
- name: Importing octavia_policy tasks
|
||||||
import_tasks: octavia_policy.yml
|
ansible.builtin.import_tasks: octavia_policy.yml
|
||||||
tags:
|
tags:
|
||||||
- octavia-install
|
- octavia-install
|
||||||
- octavia-config
|
- octavia-config
|
||||||
- octavia-policy-override
|
- octavia-policy-override
|
||||||
|
|
||||||
- name: Flush handlers
|
- name: Flush handlers
|
||||||
meta: flush_handlers
|
ansible.builtin.meta: flush_handlers
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Perform a octavia DB sync
|
- name: Perform a octavia DB sync
|
||||||
command: "{{ octavia_bin }}/octavia-db-manage upgrade head"
|
ansible.builtin.command: "{{ octavia_bin }}/octavia-db-manage upgrade head"
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ octavia_system_user_name }}"
|
become_user: "{{ octavia_system_user_name }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Perform a octavia DB sync
|
- name: Perform a octavia DB sync
|
||||||
command: "{{ octavia_bin }}/octavia-db-manage upgrade_persistence"
|
ansible.builtin.command: "{{ octavia_bin }}/octavia-db-manage upgrade_persistence"
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ octavia_system_user_name }}"
|
become_user: "{{ octavia_system_user_name }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Record the installation method
|
- name: Record the installation method
|
||||||
ini_file:
|
community.general.ini_file:
|
||||||
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||||
section: "octavia"
|
section: "octavia"
|
||||||
option: "install_method"
|
option: "install_method"
|
||||||
@@ -8,12 +8,12 @@
|
|||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
- name: Refresh local facts to ensure the octavia section is present
|
- name: Refresh local facts to ensure the octavia section is present
|
||||||
setup:
|
ansible.builtin.setup:
|
||||||
filter: ansible_local
|
filter: ansible_local
|
||||||
gather_subset: "!all"
|
gather_subset: "!all"
|
||||||
|
|
||||||
- name: Install distro packages
|
- name: Install distro packages
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ octavia_package_list }}"
|
name: "{{ octavia_package_list }}"
|
||||||
state: "{{ octavia_package_state }}"
|
state: "{{ octavia_package_state }}"
|
||||||
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: Install the python venv
|
- name: Install the python venv
|
||||||
import_role:
|
ansible.builtin.import_role:
|
||||||
name: "python_venv_build"
|
name: "python_venv_build"
|
||||||
vars:
|
vars:
|
||||||
venv_python_executable: "{{ octavia_venv_python_executable }}"
|
venv_python_executable: "{{ octavia_venv_python_executable }}"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
- (octavia_policy_overrides | length > 0) or (octavia_legacy_policy | bool)
|
- (octavia_policy_overrides | length > 0) or (octavia_legacy_policy | bool)
|
||||||
|
|
||||||
- name: Remove legacy policy.yaml file
|
- name: Remove legacy policy.yaml file
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/etc/octavia/policy.yaml"
|
path: "/etc/octavia/policy.yaml"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
# iptables module doesn't see empty string as a null value so this is the only
|
# iptables module doesn't see empty string as a null value so this is the only
|
||||||
# way to get a configurable rule definition in right now
|
# way to get a configurable rule definition in right now
|
||||||
- name: IPtables rules
|
- name: IPtables rules
|
||||||
iptables: "{{ item }}"
|
ansible.builtin.iptables: "{{ item }}"
|
||||||
with_items: "{{ octavia_iptables_rules }}"
|
with_items: "{{ octavia_iptables_rules }}"
|
||||||
when: octavia_ip_tables_fw | bool
|
when: octavia_ip_tables_fw | bool
|
||||||
|
|
||||||
@@ -24,19 +24,19 @@
|
|||||||
# in the distro does) they return 1; but do their job. If you run them
|
# in the distro does) they return 1; but do their job. If you run them
|
||||||
# directly they work. Ignoring errors for now --
|
# directly they work. Ignoring errors for now --
|
||||||
- name: Save iptables rules (Debian/Ubuntu)
|
- name: Save iptables rules (Debian/Ubuntu)
|
||||||
command: netfilter-persistent save
|
ansible.builtin.command: netfilter-persistent save
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: Save iptables rules (CentOS)
|
- name: Save iptables rules (CentOS)
|
||||||
shell: iptables-save > /etc/sysconfig/iptables
|
ansible.builtin.shell: iptables-save > /etc/sysconfig/iptables
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- ansible_facts['distribution'] == 'CentOS'
|
- ansible_facts['distribution'] == 'CentOS'
|
||||||
|
|
||||||
- name: Copy user provided HAProxy templates
|
- name: Copy user provided HAProxy templates
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
owner: "{{ octavia_system_user_name }}"
|
owner: "{{ octavia_system_user_name }}"
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
- name: Set Octavia flavor UUID fact
|
- name: Set Octavia flavor UUID fact
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
octavia_nova_flavor_uuid: "{{ get_flavor_info.flavors[0].id }}"
|
octavia_nova_flavor_uuid: "{{ get_flavor_info.flavors[0].id }}"
|
||||||
|
|
||||||
- name: Set octavia_neutron_management_network_uuid if it is not already set
|
- name: Set octavia_neutron_management_network_uuid if it is not already set
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
delay: 10
|
delay: 10
|
||||||
|
|
||||||
- name: Set Octavia management network UUID fact
|
- name: Set Octavia management network UUID fact
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
octavia_neutron_management_network_uuid: "{{ get_net_info.networks[0].id }}"
|
octavia_neutron_management_network_uuid: "{{ get_net_info.networks[0].id }}"
|
||||||
|
|
||||||
- name: Set octavia_amp_image_owner_id if it is not already set
|
- name: Set octavia_amp_image_owner_id if it is not already set
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
delay: 10
|
delay: 10
|
||||||
|
|
||||||
- name: Set Octavia amp image owner UUID fact
|
- name: Set Octavia amp image owner UUID fact
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
octavia_amp_image_owner_id: "{{ get_project_info.projects[0].id }}"
|
octavia_amp_image_owner_id: "{{ get_project_info.projects[0].id }}"
|
||||||
|
|
||||||
- name: Drop octavia Config(s)
|
- name: Drop octavia Config(s)
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Create the system group
|
- name: Create the system group
|
||||||
group:
|
ansible.builtin.group:
|
||||||
name: "{{ octavia_system_group_name }}"
|
name: "{{ octavia_system_group_name }}"
|
||||||
state: "present"
|
state: "present"
|
||||||
system: "yes"
|
system: "yes"
|
||||||
|
|
||||||
- name: Create the octavia system user
|
- name: Create the octavia system user
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: "{{ octavia_system_user_name }}"
|
name: "{{ octavia_system_user_name }}"
|
||||||
group: "{{ octavia_system_group_name }}"
|
group: "{{ octavia_system_group_name }}"
|
||||||
comment: "{{ octavia_system_comment }}"
|
comment: "{{ octavia_system_comment }}"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
home: "{{ octavia_system_home_folder }}"
|
home: "{{ octavia_system_home_folder }}"
|
||||||
|
|
||||||
- name: Create octavia dir
|
- name: Create octavia dir
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ item.owner | default(octavia_system_user_name) }}"
|
owner: "{{ item.owner | default(octavia_system_user_name) }}"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
- name: Create image download directory
|
- name: Create image download directory
|
||||||
delegate_to: "{{ octavia_service_setup_host }}"
|
delegate_to: "{{ octavia_service_setup_host }}"
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ octavia_amp_image_path }}"
|
path: "{{ octavia_amp_image_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0750"
|
mode: "0750"
|
||||||
|
|||||||
Reference in New Issue
Block a user