mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-28 13:33:57 +00:00
That is the following errors are fixed.
'206' # Variables should have spaces before and after: {{ var_name }}
'208' # File permissions unset or incorrect
'301' # Commands should not change things if nothing needs doing
'305' # Use shell only when shell functionality is required
'502' # All tasks should be named
'601' # Don't compare to literal True/False
'602' # Don't compare to empty string
RHELPLAN-73471
Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
29 lines
966 B
YAML
29 lines
966 B
YAML
# SPDX-License-Identifier: BSD-3-Clause
|
|
---
|
|
- name: Initialize NM profile exist flag
|
|
set_fact: lsr_net_profile_exists=false
|
|
|
|
- name: stat profile file
|
|
stat:
|
|
get_attributes: false
|
|
get_checksum: false
|
|
get_mime: false
|
|
path: /etc/sysconfig/network-scripts/ifcfg-{{ profile }}
|
|
register: profile_stat
|
|
|
|
- name: Set NM profile exist flag based on the profile files
|
|
set_fact: lsr_net_profile_exists=true
|
|
when: profile_stat.stat.exists
|
|
|
|
# When certain profile is marked as absent but still up, the `nmcli connection`
|
|
# still show it with FILENAME starting with /run. Only consider profile exists
|
|
# when its FILENAME is in /etc folder
|
|
- name: Get NM profile info
|
|
shell: nmcli -f NAME,FILENAME connection show |grep {{ profile }} | grep /etc
|
|
register: nm_profile_exists
|
|
ignore_errors: yes
|
|
changed_when: false
|
|
|
|
- name: Set NM profile exist flag based on the nmcli output
|
|
set_fact: lsr_net_profile_exists=true
|
|
when: nm_profile_exists.rc == 0
|