mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
bitwarden
This commit is contained in:
parent
860c906fb7
commit
418b5a0647
@ -12,13 +12,15 @@
|
|||||||
# when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router']
|
# when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router']
|
||||||
# become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
|
# become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ inventory_hostname }}"
|
||||||
|
|
||||||
- name: Upload service config
|
- name: Upload service config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: services/mqtt_srv.service
|
src: services/mqtt_srv.service
|
||||||
dest: /etc/systemd/system/
|
dest: /etc/systemd/system/
|
||||||
when: inventory_hostname not in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -28,16 +30,17 @@
|
|||||||
dest: /usr/bin/
|
dest: /usr/bin/
|
||||||
mode: '755'
|
mode: '755'
|
||||||
owner: root
|
owner: root
|
||||||
when: inventory_hostname not in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
- name: Upload service script config
|
- name: Upload service script config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: scripts/mqtt_srv.cfg
|
src: scripts/mqtt_srv.cfg
|
||||||
dest: /etc/mqtt_srv/
|
dest: /etc/mqtt_srv/
|
||||||
mode: '755'
|
mode: '755'
|
||||||
owner: root
|
owner: root
|
||||||
when: inventory_hostname not in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
# - name: Upload service script1
|
# - name: Upload service script1
|
||||||
# ansible.builtin.copy:
|
# ansible.builtin.copy:
|
||||||
# src: scripts/mqtt_srv.sh
|
# src: scripts/mqtt_srv.sh
|
||||||
@ -63,8 +66,8 @@
|
|||||||
dest: /etc/init.d/
|
dest: /etc/init.d/
|
||||||
mode: '755'
|
mode: '755'
|
||||||
owner: admin
|
owner: admin
|
||||||
when: inventory_hostname in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
- name: Upload service script2
|
- name: Upload service script2
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@ -72,8 +75,8 @@
|
|||||||
dest: /usr/bin/
|
dest: /usr/bin/
|
||||||
mode: '755'
|
mode: '755'
|
||||||
owner: admin
|
owner: admin
|
||||||
when: inventory_hostname in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
- name: Install bottle python package
|
- name: Install bottle python package
|
||||||
ansible.builtin.shell: pip install {{ item }} --break-system-packages
|
ansible.builtin.shell: pip install {{ item }} --break-system-packages
|
||||||
@ -83,15 +86,15 @@
|
|||||||
- ping3
|
- ping3
|
||||||
- psutil
|
- psutil
|
||||||
- autorandr
|
- autorandr
|
||||||
when: inventory_hostname not in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
|
|
||||||
- name: Just force systemd to reread configs (2.4 and above)
|
- name: Just force systemd to reread configs (2.4 and above)
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when: inventory_hostname not in groups['nas']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
|
|
||||||
- name: Restart mqtt_srv service
|
- name: Restart mqtt_srv service
|
||||||
@ -99,13 +102,13 @@
|
|||||||
name: mqtt_srv.service
|
name: mqtt_srv.service
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: true
|
enabled: true
|
||||||
when: inventory_hostname not in groups['nas.home.lan']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
- name: Restart mqtt service
|
- name: Restart mqtt service
|
||||||
ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)"
|
ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)"
|
||||||
async: 10
|
async: 10
|
||||||
poll: 0
|
poll: 0
|
||||||
when: inventory_hostname in groups['nas']
|
when: inventory_hostname != 'nas.home.lan'
|
||||||
become: "{{ 'no' if inventory_hostname in groups['nas.home.lan'] else 'yes' }}"
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user