Skip to content

Commit

Permalink
changed package install task to check for package before doing the in…
Browse files Browse the repository at this point in the history
…stall
  • Loading branch information
Rodrique Heron committed Sep 17, 2019
1 parent 7d53de2 commit dc290df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
---

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

- name: configure shell extras
include_tasks: configure_shell.yml

- name: ensure libvirt packages are installed
shell: >
yum install -y "{{ item }}"
rpm -q "{{ item }}" || yum install -y "{{ item }}" && echo yes
args:
warn: false
loop: "{{ libvirt_pkgs }}"
register: pkg_installed
changed_when: pkg_installed.stdout == 'yes'


- name: enable libvirt services
service:
Expand Down
5 changes: 5 additions & 0 deletions tasks/networks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
with_items: "{{ libvirt_host_networks }}"
become: True

- name: delete any previous failed attempts
file:
path: /etc/sysconfig/network-scripts/ifcfg-
state: absent

- name: setup bridge interface
template:
src: ifcfg_bridge_template.j2
Expand Down
4 changes: 4 additions & 0 deletions templates/resolv.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ search {{ search_domains|join(' ') }}
{% if vm_domain != "" %}
domain {{ vm_domain }}
{% endif %}
{% if idm_public_ip != "" %}}
nameserver {{ idm_public_ip }}
{% elif idm_public_ip == "" %}
{% for ns in dns_servers %}
nameserver {{ ns }}
{% endfor %}
{% endif %}
options rotate timeout:1

0 comments on commit dc290df

Please sign in to comment.