summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/minipc-router.yml8
-rw-r--r--ansible/roles/sane-debian-system/handlers/main.yml3
-rw-r--r--ansible/roles/sane-debian-system/tasks/main.yml8
3 files changed, 14 insertions, 5 deletions
diff --git a/ansible/minipc-router.yml b/ansible/minipc-router.yml
index 936c9ce..0bb4a32 100644
--- a/ansible/minipc-router.yml
+++ b/ansible/minipc-router.yml
@@ -6,7 +6,7 @@
vars:
# Hostname of the router.
- hostname: router
+ hostname: caprica
# The Debian mirror to use.
debian_mirror: http://ftp.fi.debian.org/debian
@@ -15,13 +15,13 @@
distro: jessie
# Your wifi network name (SSID).
- ssid: FIXME
+ ssid: Caprica
# Your country code for wifi.
- country: FIXME
+ country: FI
# Your passphrase for wifi.
- wifi_passphrase: FIXME
+ wifi_passphrase: "{{ lookup('pipe', 'pass show office_network/wifi') }}"
# Wireless device, check `iwconfig`
interface: wlan0
diff --git a/ansible/roles/sane-debian-system/handlers/main.yml b/ansible/roles/sane-debian-system/handlers/main.yml
new file mode 100644
index 0000000..bd3dc80
--- /dev/null
+++ b/ansible/roles/sane-debian-system/handlers/main.yml
@@ -0,0 +1,3 @@
+- name: update hostname
+ shell: hostname {{ hostname }}
+ become_user: root
diff --git a/ansible/roles/sane-debian-system/tasks/main.yml b/ansible/roles/sane-debian-system/tasks/main.yml
index c445a4e..2d5caac 100644
--- a/ansible/roles/sane-debian-system/tasks/main.yml
+++ b/ansible/roles/sane-debian-system/tasks/main.yml
@@ -1,7 +1,13 @@
# Set hostname.
- name: set hostname
- hostname: name={{ hostname }}
+ copy:
+ content: "{{ hostname }}\n"
+ dest: /etc/hostname
+ owner: root
+ group: root
+ mode: 0644
+ notify: update hostname
- name: add hostname to /etc/hosts
lineinfile: