summaryrefslogtreecommitdiff
path: root/.ansible
diff options
context:
space:
mode:
Diffstat (limited to '.ansible')
-rw-r--r--.ansible/README16
-rw-r--r--.ansible/personalised.yml19
2 files changed, 35 insertions, 0 deletions
diff --git a/.ansible/README b/.ansible/README
new file mode 100644
index 0000000..a753811
--- /dev/null
+++ b/.ansible/README
@@ -0,0 +1,16 @@
+personalised.yaml is a basic ansible playbook to personalise the
+servers I work with, used with ansible 2.5.3.
+
+ssh-agent should be running, host_vars should be set with
+ansible-vault, e.g.:
+
+ ansible-vault create host_vars/example.com.yaml
+
+With contents such as:
+
+ ansible_become_password: examplepassword
+
+Invoked with:
+
+ ansible-playbook --ask-vault-pass ~/.ansible/personalised.yml
+
diff --git a/.ansible/personalised.yml b/.ansible/personalised.yml
new file mode 100644
index 0000000..3db2bc7
--- /dev/null
+++ b/.ansible/personalised.yml
@@ -0,0 +1,19 @@
+- hosts: personalised
+ tasks:
+ - name: Ensure emacs is installed on CentOS
+ become: yes
+ yum:
+ name: emacs-nox
+ state: latest
+ when: ansible_os_family == "RedHat"
+ - name: Ensure emacs is installed on Debian
+ become: yes
+ apt:
+ name: emacs25-nox
+ state: latest
+ when: ansible_os_family == "Debian"
+ - name: Set emacs as EDITOR for myself
+ lineinfile:
+ path: ~/.profile
+ regexp: '^export EDITOR='
+ line: 'export EDITOR=emacs'