From ea28d377ca1485d353d23b09852381988cc89a4e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 31 Mar 2017 04:50:32 +0200 Subject: [PATCH 1/1] added basic infra for ansible playbooks and roles --- README-vault | 11 +++++++++++ ansible.cfg | 13 +++++++++++++ hosts | 24 ++++++++++++++++++++++++ log | 1 + open-vault.sh | 3 +++ secrets/dummy.yaml | 6 ++++++ vault-pass.gpg | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 110 insertions(+) create mode 100644 README-vault create mode 100644 ansible.cfg create mode 100644 hosts create mode 100644 log create mode 100755 open-vault.sh create mode 100644 secrets/dummy.yaml create mode 100644 vault-pass.gpg diff --git a/README-vault b/README-vault new file mode 100644 index 0000000..0e09ec0 --- /dev/null +++ b/README-vault @@ -0,0 +1,11 @@ +Creating key: + pwgen -s 128 -1 | gpg2 -e -a -o vault-pass.gpg + +Reencrypt for new set of keys: + ./open-vault.sh | gpg2 -e -a -o vault-pass.gpg + +Create a new vault file: + ansible-vault create secrets/foo.yaml + +Edit a vault file: + ansible-vault edit secrets/foo.yaml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..09bd8fe --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,13 @@ +[defaults] +inventory = ./hosts +remote_user = root +log_path = ./log +nocows=1 +vault_password_file = ./open-vault.sh + +gathering = smart +var_compression_level = 9 + +[ssh_connection] +pipelining = True +ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s diff --git a/hosts b/hosts new file mode 100644 index 0000000..2f4919d --- /dev/null +++ b/hosts @@ -0,0 +1,24 @@ +[baremetalservers] +alfred + +[kvmhosts] +alfred + +[virtualservers] +athsdisc +calendar +ctf +entrance +galley +hacksch +r3home +tickets +tools + +[servers:children] +baremetalservers +virtualservers + + +[desktops] +wuerfel diff --git a/log b/log new file mode 100644 index 0000000..cd521ee --- /dev/null +++ b/log @@ -0,0 +1 @@ +2017-03-31 04:46:19,866 p=15260 u=equinox | ERROR! Missing target hosts diff --git a/open-vault.sh b/open-vault.sh new file mode 100755 index 0000000..9490484 --- /dev/null +++ b/open-vault.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec gpg2 --decrypt --batch < "${BASH_SOURCE%/*}/vault-pass.gpg" 2> /dev/null diff --git a/secrets/dummy.yaml b/secrets/dummy.yaml new file mode 100644 index 0000000..8c5c6b1 --- /dev/null +++ b/secrets/dummy.yaml @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +61386232386136363036383864626534633964363664303338326562386239643134376563613434 +3133616561366134623038663730356435353564623637640a656561653961343861623932343733 +38346565303536373235646537623766663737363331663333623266633234363764653734343037 +6364616234396665380a356235623063383936303033313436626234663261363164343436353266 +6262 diff --git a/vault-pass.gpg b/vault-pass.gpg new file mode 100644 index 0000000..d333e16 --- /dev/null +++ b/vault-pass.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP MESSAGE----- + +hQIMA+Qd5U24qffPAQ//d9gulPUkndUq2aen6WpLeyNqmM0EQK+1Vc20e3sKAmQW +6W1TCt7BIWj13Lmv5D0capuyLXYKrWxGLPazIDcvd6UvBGjvfnCdSecZJDhzQVtH +ijurbkNjlfnzdVKv6pHRi3NA0/VXyKu4KlpaJxD56qWnB+y+OINESax7Nnbg0Crg +kwI+/7b56lElBY2e1HFFE71ARsgx9NGuGh3ZLem4qv3uzbdo7PygKijc1udfBmpO +3K94w3GSI0rahtGkU36JnbIXdqce8cEAtU13ThDXkIPcFtGy4o8B62G1EIB+MgzR +wWYUJrCx4mZ9k+5EIEO3zjn4wPcOwibVuuxhG+mWVjbtUo5I4EeGn/cklwJ9ERe0 +Q+WeEws4RYiItq0mk0vS+arNUmUqtL7/OCum8kZsqze4bQ9/95GlYNB71Q1GsWoN +kHeaqJw+koh3BrsQcw8CaUc/XVHXesl9A2feXtQnbd3FQtPSdVgWQ3Fq88XO/T3+ +Rmk+1QIrCg/4j6XGSHRMuHm3V6F/WyuvQOE/G9wZpdbmlJf9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