bitwarden

This commit is contained in:
jaydee
2024-12-10 13:19:35 +01:00
parent f4a17b16df
commit 88af9ed79d
7 changed files with 40 additions and 20 deletions

View File

@ -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:

View File

@ -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