Merge "Reduce fact gathering"
This commit is contained in:
commit
c739f33f4e
|
@ -29,12 +29,25 @@
|
||||||
block:
|
block:
|
||||||
- name: Update facts before attempting to disable interfaces
|
- name: Update facts before attempting to disable interfaces
|
||||||
setup:
|
setup:
|
||||||
- name: Find the ifcg files
|
- name: Find the ifcfg files
|
||||||
find:
|
find:
|
||||||
paths: /etc/sysconfig/network-scripts/
|
paths: /etc/sysconfig/network-scripts/
|
||||||
patterns: ifcfg-*
|
patterns: ifcfg-*
|
||||||
register: ifcfg_files
|
register: ifcfg_files
|
||||||
|
# NOTE(mwhahaha): On computes collecting all the network facts is a huge
|
||||||
|
# performance issue. So let's only get the ansible facts for the ifcfg
|
||||||
|
# files which will avoid all the tap interfaces. This takes a while but
|
||||||
|
# results in less memory utilization for the rest of the deployment.
|
||||||
|
- name: Get ifcfg facts
|
||||||
|
setup:
|
||||||
|
gather_subset:
|
||||||
|
- '!all'
|
||||||
|
- '!min'
|
||||||
|
- network
|
||||||
|
filter: "{{ 'ansible_' + item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') | replace('-', '_') }}"
|
||||||
|
loop: "{{ ifcfg_files.files |flatten(levels=1)}}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') | replace('-', '_') }}"
|
||||||
- name: Replace BOOTPROTO to none for interfaces which does not have IP
|
- name: Replace BOOTPROTO to none for interfaces which does not have IP
|
||||||
replace:
|
replace:
|
||||||
dest: "{{ item.path }}"
|
dest: "{{ item.path }}"
|
||||||
|
|
|
@ -15,12 +15,15 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
- name: gather package facts
|
- name: Check if lvm2 is installed
|
||||||
package_facts:
|
shell: rpm -q lvm2
|
||||||
manager: auto
|
become: true
|
||||||
|
failed_when: false
|
||||||
|
register: lvm_pkg_check
|
||||||
- name: gather allowed block devices list
|
- name: gather allowed block devices list
|
||||||
when:
|
when:
|
||||||
- "'lvm2' in ansible_facts.packages"
|
- lvm_pkg_check.rc is defined
|
||||||
|
- lvm_pkg_check.rc == 0
|
||||||
- tripleo_tripleo_lvmfilter_enabled or tripleo_tripleo_lvmfilter_dry_run
|
- tripleo_tripleo_lvmfilter_enabled or tripleo_tripleo_lvmfilter_dry_run
|
||||||
block:
|
block:
|
||||||
- name: collect in-use lvm2 devices list
|
- name: collect in-use lvm2 devices list
|
||||||
|
|
|
@ -14,12 +14,13 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
- name: Collect Network Facts
|
- name: Collect default network fact
|
||||||
setup:
|
setup:
|
||||||
gather_subset:
|
gather_subset:
|
||||||
- '!all'
|
- '!all'
|
||||||
- '!any'
|
- '!min'
|
||||||
- network
|
- network
|
||||||
|
filter: 'ansible_default_ipv4'
|
||||||
|
|
||||||
- name: Check Default IPv4 Gateway availability
|
- name: Check Default IPv4 Gateway availability
|
||||||
command: "ping -w 10 -c 1 {{ ansible_facts.default_ipv4.gateway }}"
|
command: "ping -w 10 -c 1 {{ ansible_facts.default_ipv4.gateway }}"
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
gather_subset:
|
gather_subset:
|
||||||
- '!all'
|
- '!all'
|
||||||
- '!min'
|
- '!min'
|
||||||
- 'interfaces'
|
- 'network'
|
||||||
|
filter: 'ansible_interfaces'
|
||||||
|
|
||||||
- name: Delete legacy cni0 interface (podman < 1.6)
|
- name: Delete legacy cni0 interface (podman < 1.6)
|
||||||
command: ip link delete cni0
|
command: ip link delete cni0
|
||||||
|
|
Loading…
Reference in New Issue