aboutsummaryrefslogtreecommitdiffstats
path: root/roles/debian/tasks/hostname.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/debian/tasks/hostname.yml')
-rw-r--r--roles/debian/tasks/hostname.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/debian/tasks/hostname.yml b/roles/debian/tasks/hostname.yml
new file mode 100644
index 0000000..6709c03
--- /dev/null
+++ b/roles/debian/tasks/hostname.yml
@@ -0,0 +1,15 @@
+---
+- name: Set hostname
+ hostname:
+ name: '{{ hostname }}'
+ when: not chroot
+- name: '- when in chroot'
+ copy:
+ dest: '/etc/hostname'
+ content: "{{ hostname }}\n"
+ owner: root
+ group: root
+ mode: 0644
+ when: chroot
+
+# vim: set ts=2 sw=2 et: