From 4df5ce21ffbbacaf5c931174c5a6be8778641f6b Mon Sep 17 00:00:00 2001 From: defanor Date: Sun, 10 Jun 2018 11:55:30 +0300 Subject: Add ansible configuration --- .ansible/README | 16 ++++++++++++++++ .ansible/personalised.yml | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .ansible/README create mode 100644 .ansible/personalised.yml (limited to '.ansible') 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' -- cgit v1.2.3