From adb3ab2c376978616ed86430bf1edfa758b2c932 Mon Sep 17 00:00:00 2001 From: Tobias Lehmann Date: Tue, 16 Apr 2024 08:30:54 +0200 Subject: [PATCH] Added timescaledb playbook --- README.md | 1 + playbooks/captica-automation-timescaledb.yml | 51 ++++++++++++++++++++ requirements.yml | 5 ++ 3 files changed, 57 insertions(+) create mode 100644 playbooks/captica-automation-timescaledb.yml diff --git a/README.md b/README.md index 3de708d..12492ac 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Be sure the root ssh pub key is already installed. If not and password auth is a Run playbook to install the serves ```bash +ansible-playbook -v -i inventory/hosts.yml --user=root --ask-vault-pass --extra-vars '@secrets/vault.yml' playbooks/captica-automation-nodered-datalogger.yml ansible-playbook -v -i inventory/hosts.yml --user=root --ask-vault-pass --extra-vars '@secrets/vault.yml' playbooks/captica-webserver.yml ``` diff --git a/playbooks/captica-automation-timescaledb.yml b/playbooks/captica-automation-timescaledb.yml new file mode 100644 index 0000000..d154fa9 --- /dev/null +++ b/playbooks/captica-automation-timescaledb.yml @@ -0,0 +1,51 @@ +- hosts: "leh01" + name: Create container + vars: + lxc_id: 110 + lxc_name: timescaledb + lxc_domain: leh01.local + lxc_template: "local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst" + lxc_mac: CC:CC:CC:15:01:10 + lxc_bridge: vmbr150 + lxc_vlan: "" + lxc_disk: datapool:32 + lxc_cpu: 2 + lxc_memory: 2048 + lxc_swap: 1024 + lxc_mounts: '{}' + lxc_ssh_pub_key: ~/.ssh/id_ed25519_ansible.pub + roles: + - lxc-container + +- hosts: "timescaledb" + vars: + hostname: timescaledb + tools_install_users: + - root + - ansible + ssh_pubkeys_root: + - "../files/ssh/root.pub" + ssh_pubkeys_ansible: + - "../files/ssh/id_ed25519_ansible.pub" + roles: + - linux-base-install + - zsh + - vim + - fzf + + +- hosts: "timescaledb" + vars: + postgresql_admin_password: captica + postgresql_allowed_hosts: + - '192.168.150.1/32' + - '192.168.110.1/32' + timescaledb_database_name: datalogger + timescaledb_database_schema: captica + timescaledb_database_user: captica + timescaledb_database_password: captica + tools_install_users: + - ansible + - root + roles: + - timescaledb \ No newline at end of file diff --git a/requirements.yml b/requirements.yml index 7be5079..9c65d2d 100644 --- a/requirements.yml +++ b/requirements.yml @@ -45,6 +45,11 @@ roles: scm: git version: main + - name: timescaledb + src: git@git.captica.de:captica-automation/de.captica.automation.ansible.role.timescaledb.git + scm: git + version: main + # Collections requirements collections: - name: community.general