mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
Compare commits
No commits in common. "5ec4037fa340c042694a8f2e826ef6b2c8588d19" and "7a538639c66df54d72a4510b1567f7ff7a67f2b3" have entirely different histories.
5ec4037fa3
...
7a538639c6
18
desktop.yml
18
desktop.yml
@ -1,15 +1,9 @@
|
|||||||
---
|
---
|
||||||
- hosts: desktop
|
- hosts: desktop
|
||||||
roles:
|
roles:
|
||||||
- role: common
|
- common
|
||||||
tags: common
|
- wake_on_lan
|
||||||
- role: wake_on_lan
|
- timeshift
|
||||||
tags: wake_on_lan
|
- zabbix-agent
|
||||||
- role: timeshift
|
- autofs_client
|
||||||
tags: timeshift
|
- ldap_client
|
||||||
- role: zabbix-agent
|
|
||||||
tags: zabbix-agent
|
|
||||||
- role: autofs_client
|
|
||||||
tags: autofs_client
|
|
||||||
- role: ldap_client
|
|
||||||
tags: ldap_client
|
|
@ -1,69 +0,0 @@
|
|||||||
- block:
|
|
||||||
- name: include vault
|
|
||||||
ansible.builtin.include_vars:
|
|
||||||
file: jaydee.yml
|
|
||||||
- name: Delete content & directory
|
|
||||||
ansible.builtin.file:
|
|
||||||
state: absent
|
|
||||||
path: "{{ dest_folder }}"
|
|
||||||
- name: GIT pull
|
|
||||||
tags:
|
|
||||||
- git_pull
|
|
||||||
git:
|
|
||||||
repo: "https://{{ git_user | urlencode }}:{{ git_password_mqtt | urlencode }}@gitlab.sectorq.eu/jaydee/omv_backup.git"
|
|
||||||
dest: "{{ dest_folder }}"
|
|
||||||
update: yes
|
|
||||||
clone: yes
|
|
||||||
version: main
|
|
||||||
- debug:
|
|
||||||
msg: "{{ inventory_hostname }}"
|
|
||||||
- name: Create a directory if it does not exist
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /myapps
|
|
||||||
state: directory
|
|
||||||
mode: '0755'
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
|
|
||||||
- name: Upload script
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "{{ dest_folder }}/omv_backup.py"
|
|
||||||
dest: /myapps/omv_backup.py
|
|
||||||
remote_src: true
|
|
||||||
mode: '0755'
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
when: inventory_hostname != 'nas.home.lan'
|
|
||||||
|
|
||||||
- name: Upload requirements
|
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "{{ dest_folder }}/requirements.txt"
|
|
||||||
dest: /myapps/requirements.txt
|
|
||||||
remote_src: true
|
|
||||||
when: inventory_hostname != 'nas.home.lan'
|
|
||||||
|
|
||||||
- name: Install venv
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name:
|
|
||||||
- python3-virtualenv
|
|
||||||
|
|
||||||
- name: Install specified python requirements in indicated (virtualenv)
|
|
||||||
ansible.builtin.pip:
|
|
||||||
requirements: /myapps/requirements.txt
|
|
||||||
virtualenv: /myapps/venv
|
|
||||||
|
|
||||||
- name: 'Ensure an old job is no longer present. Removes any job that is prefixed by "#Ansible: an old job" from the crontab'
|
|
||||||
ansible.builtin.cron:
|
|
||||||
name: "omv_backup"
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure a job that runs at 2 and 5 exists. Creates an entry like "0 5,2 * * ls -alh > /dev/null"
|
|
||||||
ansible.builtin.cron:
|
|
||||||
name: "omv_backup"
|
|
||||||
minute: "0"
|
|
||||||
hour: "8"
|
|
||||||
job: "/myapps/venv/bin/python3 /myapps/omv_backup.py -b > /dev/null 2>&1 &"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
become: true
|
|
@ -1 +0,0 @@
|
|||||||
dest_folder: "/tmp/ans_repo"
|
|
@ -1,12 +0,0 @@
|
|||||||
- block:
|
|
||||||
- name: Creating a file with content
|
|
||||||
copy:
|
|
||||||
dest: "/etc/polkit-1/rules.d/50_disable_pol.rules"
|
|
||||||
content: |
|
|
||||||
polkit.addRule(function(action, subject) {
|
|
||||||
if (action.id == "org.freedesktop.NetworkManager.wifi.scan") {
|
|
||||||
return polkit.Result.YES;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user