Doug Aaser f3cbed1d96 [AIR-209] Remove privilege escalation
This PS removes privilege escalation from the roles so that these roles
can be used in a developer environment

Change-Id: I44ddc18532ee75b0d398896d470ecf949ad4496a
2020-01-21 12:11:16 -05:00

35 lines
833 B
YAML

# Description:
# Add given hosts to existing libvirt network
#
# Inputs:
# network_action: "add_dhcp_hosts"
# network_args:
# name: <name of network>
# hosts:
# - name:
# mac:
# ip:
# - name:
# mac:
# ip:
- name: Validate input
assert:
that:
- "network_args is defined"
- "network_args.name is defined"
- "network_args.hosts is defined"
- "network_args.hosts | list"
- name: add dhcp hosts to network
environment:
LIBVIRT_DEFAULT_URI: qemu:///system
shell: >-
virsh net-update {{ network_args.name }} \
add --section ip-dhcp-host \
--xml "<host mac='{{ single_dhcp_host.mac}}' ip='{{ single_dhcp_host.name }}'/>" \
--config --live
loop: "{{ network_args.hosts }}"
loop_control:
loop_var: single_dhcp_host