Skip to content

Commit dc290df

Browse files
author
Rodrique Heron
committed
changed package install task to check for package before doing the install
1 parent 7d53de2 commit dc290df

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

tasks/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
---
22

3-
- name: validate virtuaization extentions are available to this host
3+
- name: validate virtualization extensions are available to this host
44
include_tasks: validate.yml
55

66
- name: configure shell extras
77
include_tasks: configure_shell.yml
88

99
- name: ensure libvirt packages are installed
1010
shell: >
11-
yum install -y "{{ item }}"
11+
rpm -q "{{ item }}" || yum install -y "{{ item }}" && echo yes
12+
args:
13+
warn: false
1214
loop: "{{ libvirt_pkgs }}"
15+
register: pkg_installed
16+
changed_when: pkg_installed.stdout == 'yes'
17+
1318

1419
- name: enable libvirt services
1520
service:

tasks/networks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
with_items: "{{ libvirt_host_networks }}"
2222
become: True
2323

24+
- name: delete any previous failed attempts
25+
file:
26+
path: /etc/sysconfig/network-scripts/ifcfg-
27+
state: absent
28+
2429
- name: setup bridge interface
2530
template:
2631
src: ifcfg_bridge_template.j2

templates/resolv.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ search {{ search_domains|join(' ') }}
66
{% if vm_domain != "" %}
77
domain {{ vm_domain }}
88
{% endif %}
9+
{% if idm_public_ip != "" %}}
10+
nameserver {{ idm_public_ip }}
11+
{% elif idm_public_ip == "" %}
912
{% for ns in dns_servers %}
1013
nameserver {{ ns }}
1114
{% endfor %}
15+
{% endif %}
1216
options rotate timeout:1

0 commit comments

Comments
 (0)