aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/tasks/dhcpd.yml
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2017-11-07 16:27:49 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2017-11-12 14:56:32 +0100
commite8cdba85c48dcbbd42e6fcb5be3aa2912008cb84 (patch)
tree41ba5163cf6f110521f2ebc9035f77d2754796a0 /roles/space_server/tasks/dhcpd.yml
downloadlabitat-ansible-e8cdba85c48dcbbd42e6fcb5be3aa2912008cb84.tar.gz
labitat-ansible-e8cdba85c48dcbbd42e6fcb5be3aa2912008cb84.tar.xz
labitat-ansible-e8cdba85c48dcbbd42e6fcb5be3aa2912008cb84.zip
initial commit
Diffstat (limited to 'roles/space_server/tasks/dhcpd.yml')
-rw-r--r--roles/space_server/tasks/dhcpd.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/space_server/tasks/dhcpd.yml b/roles/space_server/tasks/dhcpd.yml
new file mode 100644
index 0000000..c72fa75
--- /dev/null
+++ b/roles/space_server/tasks/dhcpd.yml
@@ -0,0 +1,31 @@
+---
+- name: Install dhcpd package
+ dnf:
+ name: dhcp-server
+ state: latest
+ notify:
+ - restart dhcpd
+ tags:
+ - packages
+
+- name: Configure dhcpd
+ copy:
+ src: dhcpd/dhcpd.conf
+ dest: '/etc/dhcp/dhcpd.conf'
+ notify:
+ - restart dhcpd
+
+- name: Enable dhcpd service
+ systemd:
+ name: dhcpd.service
+ enabled: yes
+ masked: no
+ state: started
+ when: "'container' not in ansible_env"
+- name: '- when in nspawn'
+ command: systemctl enable dhcpd.service
+ args:
+ creates: '/etc/systemd/system/multi-user.target.wants/dhcpd.service'
+ when: "'container' in ansible_env"
+
+# vim: set ts=2 sw=2 et: