From 88af9ed79db5fb64f66bbd2ddcc055a11050f18c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 10 Dec 2024 13:19:35 +0100 Subject: [PATCH] bitwarden --- hosts_init.yml | 1 + hosts_roles.yml | 1 + jaydee.yml | 22 +++++++++++++--------- playbooks/install_mqtt_srv.yml | 22 +++++++++++++++------- playbooks/update_ssh_keys.yml | 6 +++--- roles/wake_on_lan/tasks/main.yml | 1 + servers.yml | 7 ++++++- 7 files changed, 40 insertions(+), 20 deletions(-) diff --git a/hosts_init.yml b/hosts_init.yml index 5a6704d..f0b1d07 100644 --- a/hosts_init.yml +++ b/hosts_init.yml @@ -6,6 +6,7 @@ datacenter: rpi5-1.home.lan: rpi5.home.lan: m-server.home.lan: + amd.home.lan: fog.home.lan: zabbix.home.lan: omv.home.lan: diff --git a/hosts_roles.yml b/hosts_roles.yml index 02045ab..4caf994 100644 --- a/hosts_roles.yml +++ b/hosts_roles.yml @@ -91,6 +91,7 @@ datacenter: omv.home.lan: rack.home.lan: m-server.home.lan: + amd.home.lan: vars: ansible_python_interpreter: /usr/bin/python3 ansible_ssh_user: jd diff --git a/jaydee.yml b/jaydee.yml index 4485b6b..2bb2aa4 100644 --- a/jaydee.yml +++ b/jaydee.yml @@ -1,10 +1,14 @@ $ANSIBLE_VAULT;1.1;AES256 -34333030653639366130323937336630636664636561373965636631616462306464653530303234 -6639353330396532353361303162653133633239336661300a343739393635376632613133393465 -63363966653435613438393735316564663164623965373137336637383365666430663065393465 -6364356362373739620a653666656633373535646131653965393335386138313534323034363833 -66353831663230336234356438386130313231333665333865386139323662313963386162333530 -32613439353937646265386463623833636438343731383030313531616430633739656134373939 -66663838386532623762323666646638373363666363373438303739346130363133353763383633 -38313233376231373037633035313337353735626433333064383136333763396664373930363663 -34356331383237646465653966626533613666396633336236643730343066633636 +61613261633665363264613930356231343938373661393866346462636562383338656538336537 +3563656432616633323265613261333566616461396330310a633166383532393261646530633235 +39643461613864623731306239663931636331323534316539646163356338366562373766363565 +6263663266633133330a313366346464616239336565623764666234646530363534303430623131 +64376538336436306436346134376335346339346336343364633137623561353637613461643366 +65313133333765343263303633333163666132626262393531386235396361333165336632666639 +62363939303133343136646634653963376163363864393235346636356532396464666463343664 +36646330666534373435646436613664353265336165663934333263303166343061346430336265 +34346435616465383430363935346335336332643730666238383630653631623663376535626362 +65626130396538653634643363643838343933353565376362653636333936343832316432643563 +31386239646466313862366563383765626331313333326266653864373638336632336665393137 +38623731663534396333643464623935396662366631633865353334303663616565326536636636 +3766 diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index bc87a6d..627feaf 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -3,7 +3,7 @@ ignore_unreachable: false ignore_errors: true vars: - dest_folder: "/share/Public/ans_repo1" + dest_folder: "/share/Public/ans_repo" tasks: # - name: Install python3-pip # ansible.builtin.apt: @@ -16,6 +16,11 @@ - name: include vault ansible.builtin.include_vars: file: ../jaydee.yml + - name: Delete content & directory + ansible.builtin.file: + state: absent + path: "{{ dest_folder }}" + become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" - name: GIT pull become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" tags: @@ -32,29 +37,33 @@ - name: Upload service config ansible.builtin.copy: src: "{{ dest_folder }}/mqtt_srv.service" - dest: /etc/systemd/system/ + dest: /etc/systemd/system/mqtt_srv.service + remote_src: true when: inventory_hostname != 'nas.home.lan' become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" - + - name: Upload service script ansible.builtin.copy: src: "{{ dest_folder }}/mqtt_srv.py" - dest: /usr/bin/ + dest: /usr/bin/mqtt_srv.py mode: '755' owner: root + remote_src: true when: inventory_hostname != 'nas.home.lan' become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" - + - name: Upload service script config ansible.builtin.copy: src: "{{ dest_folder }}/mqtt_srv.cfg" - dest: /etc/mqtt_srv/ + dest: /etc/mqtt_srv/mqtt_srv.cfg mode: '755' owner: root + remote_src: true when: inventory_hostname != 'nas.home.lan' become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" + # - name: Upload service script1 # ansible.builtin.copy: # src: scripts/mqtt_srv.sh @@ -94,7 +103,6 @@ remote_src: true when: inventory_hostname == 'nas.home.lan' become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" - - name: Install bottle python package ansible.builtin.shell: pip install {{ item }} --break-system-packages loop: diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 9f8089b..203b209 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -1,4 +1,4 @@ -- hosts: "{{ hosts }}" +- hosts: datacenter tasks: # Deploy SSH Key # -- @@ -9,12 +9,12 @@ mode: '0700' - name: Download id_rsa ansible.builtin.get_url: - url: http://192.168.77.106:48000/ssh/id_rsa + url: http://192.168.77.101:48000/ssh/id_rsa dest: ~/.ssh/id_rsa mode: '0600' - name: Download id_rsa.pub ansible.builtin.get_url: - url: http://192.168.77.106:48000/ssh/id_rsa.pub + url: http://192.168.77.101:48000/ssh/id_rsa.pub dest: ~/.ssh/id_rsa.pub mode: '0600' - name: get remote file contents diff --git a/roles/wake_on_lan/tasks/main.yml b/roles/wake_on_lan/tasks/main.yml index c03cd9e..9674660 100644 --- a/roles/wake_on_lan/tasks/main.yml +++ b/roles/wake_on_lan/tasks/main.yml @@ -2,6 +2,7 @@ ansible.builtin.apt: name: ethtool state: present + become: true - name: Display all interfaces name debug: var: ansible_facts.interfaces diff --git a/servers.yml b/servers.yml index 0c1f556..64e7a28 100644 --- a/servers.yml +++ b/servers.yml @@ -3,4 +3,9 @@ roles: - common - wake_on_lan - - monitoring \ No newline at end of file + - matter-server + - docker + - timeshift + - monitoring + - zabbix-agent + - autofs-client