Skip to content

Commit 012f77b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Replace local_action with delegate to localhost"
2 parents a22e6e9 + 2f8cc7b commit 012f77b

File tree

17 files changed

+60
-54
lines changed

17 files changed

+60
-54
lines changed

ansible/baremetal-compute-introspection-data-save.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
4545

4646
- name: Ensure introspection data output directory exists
47-
local_action:
48-
module: file
47+
delegate_to: localhost
48+
file:
4949
path: "{{ output_dir }}"
5050
state: directory
5151

5252
- name: Ensure introspection data is saved locally
53-
local_action:
54-
module: copy
53+
delegate_to: localhost
54+
copy:
5555
content: "{{ introspection_data_map[output_format | lower] }}"
5656
dest: "{{ output_dir }}/{{ inventory_hostname }}.{{ output_format | lower }}"
5757
when: save_result.rc == 0

ansible/docker-registry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
- docker-registry
1313
roles:
1414
- role: docker-registry
15-
docker_registry_action: "{{ kayobe_action }}"
15+
docker_registry_action: "{{ kayobe_action | default('deploy') }}"
1616
docker_registry_config_path: "{{ config_path }}/docker-registry"

ansible/drac-facts.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
- role: stackhpc.drac-facts
1212
tasks:
1313
- name: Gather facts via DRAC
14-
local_action:
15-
module: drac_facts
14+
delegate_to: localhost
15+
drac_facts:
1616
address: "{{ ipmi_address }}"
1717
username: "{{ ipmi_username }}"
1818
password: "{{ ipmi_password }}"
@@ -23,7 +23,7 @@
2323
var: result
2424

2525
- name: Write facts to a file
26-
local_action:
27-
module: copy
26+
delegate_to: localhost
27+
copy:
2828
content: "{{ result }}"
2929
dest: "/tmp/drac-facts-{{ inventory_hostname }}.json"

ansible/dump-config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@
2020
dump_hosts: all
2121
tasks:
2222
- name: Create configuration dump directory
23-
local_action:
24-
module: file
23+
delegate_to: localhost
24+
file:
2525
path: "{{ dump_path }}"
2626
state: directory
2727

2828
- name: Write host config to file
29-
local_action:
30-
module: copy
29+
delegate_to: localhost
30+
copy:
3131
content: "{{ hostvars[inventory_hostname] | to_nice_yaml }}"
3232
dest: "{{ dump_path }}/{{ inventory_hostname }}.yml"
3333
when: dump_var_name is not defined
3434

3535
- name: Write host variable to file
36-
local_action:
37-
module: copy
36+
delegate_to: localhost
37+
copy:
3838
content: "{{ hostvars[inventory_hostname][dump_var_name] | to_nice_yaml }}"
3939
dest: "{{ dump_path }}/{{ inventory_hostname }}.yml"
4040
when: dump_var_name is defined
4141

4242
# - name: Write merged config to file
43-
# local_action:
44-
# module: copy
43+
# delegate_to: localhost
44+
# copy:
4545
# content: "{{ hostvars | merge_config | to_nice_yaml }}"
4646
# dest: "{{ dump_path }}/merged.yml

ansible/opensm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
- opensm
1313
roles:
1414
- role: opensm
15-
opensm_action: "{{ kayobe_action }}"
15+
opensm_action: "{{ kayobe_action | default('deploy') }}"

ansible/overcloud-introspection-data-save.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
become: "{{ container_engine == 'podman' }}"
3939

4040
- name: Ensure introspection data output directory exists
41-
local_action:
42-
module: file
41+
delegate_to: localhost
42+
file:
4343
path: "{{ output_dir }}"
4444
state: directory
4545

4646
- name: Ensure introspection data is saved locally
47-
local_action:
48-
module: copy
47+
delegate_to: localhost
48+
copy:
4949
content: "{{ introspection_data_map[output_format | lower] }}"
5050
dest: "{{ output_dir }}/{{ inventory_hostname }}.{{ output_format | lower }}"
5151
when: save_result.rc == 0

ansible/overcloud-inventory-discover.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
ironic_inventory: "{{ inventory_result.stdout | from_json }}"
2424

2525
- name: Ensure Kayobe overcloud inventory exists
26-
local_action:
27-
module: copy
26+
delegate_to: localhost
27+
copy:
2828
content: |
2929
# Managed by Ansible - do not edit.
3030
# This is the Kayobe overcloud inventory, autogenerated from the seed

ansible/overcloud-provision.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@
221221
- final_provision_state != 'active'
222222

223223
- name: Wait for SSH access to the nodes
224-
local_action:
225-
module: wait_for
224+
delegate_to: localhost
225+
wait_for:
226226
host: "{{ ansible_host }}"
227227
port: 22
228228
state: started

ansible/roles/console-allocation/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# NOTE(mgoddard): Use the Python interpreter used to run ansible-playbook,
3636
# since this has Python dependencies available to it (PyYAML).
3737
ansible_python_interpreter: "{{ ansible_playbook_python }}"
38-
local_action:
39-
module: console_allocation
38+
delegate_to: localhost
39+
console_allocation:
4040
allocation_file: "{{ console_allocation_filename }}"
4141
nodes: "{{ console_allocation_ironic_nodes }}"
4242
allocation_pool_start: "{{ console_allocation_pool_start }}"

ansible/roles/dell-switch/tasks/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
22
- name: Ensure DellOS6 switches are configured
3-
local_action:
4-
module: dellos6_config
3+
delegate_to: localhost
4+
dellemc.os6.os6:
55
provider: "{{ dell_switch_provider }}"
66
src: "{{ lookup('template', 'dellos6-config.j2') }}"
77
save: "{{ dell_switch_save | bool }}"
88
when: dell_switch_type == 'dellos6'
99

1010
- name: Ensure DellOS9 switches are configured
11-
local_action:
12-
module: dellos9_config
11+
delegate_to: localhost
12+
dellemc.os9.os9:
1313
provider: "{{ dell_switch_provider }}"
1414
src: "{{ lookup('template', 'dellos9-config.j2') }}"
1515
save: "{{ dell_switch_save | bool }}"
1616
when: dell_switch_type == 'dellos9'
1717

1818
- name: Ensure DellOS10 switches are configured
19-
local_action:
20-
module: dellos10_config
19+
delegate_to: localhost
20+
dellemc.os10.os10:
2121
provider: "{{ dell_switch_provider }}"
2222
src: "{{ lookup('template', 'dellos10-config.j2') }}"
2323
save: "{{ dell_switch_save | bool }}"

0 commit comments

Comments
 (0)