Compare commits
No commits in common. "3ed71a34ecfed911dd64b6f82ec0144abba23208" and "5ad74e8f9db2141617c354b7b69151308a724360" have entirely different histories.
3ed71a34ec
...
5ad74e8f9d
1
home.yml
1
home.yml
@ -5,7 +5,6 @@
|
|||||||
vars_files:
|
vars_files:
|
||||||
- vars/users.yml
|
- vars/users.yml
|
||||||
- vars/home.yml
|
- vars/home.yml
|
||||||
- vars/nas_secrets.yml
|
|
||||||
- vars/nas.yml
|
- vars/nas.yml
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
@ -1,23 +1,2 @@
|
|||||||
---
|
---
|
||||||
# defaults file for nut
|
# defaults file for nut
|
||||||
nut_mode: "standalone"
|
|
||||||
upsd_users:
|
|
||||||
- name: upsmonitor
|
|
||||||
password: upsmonitorpass
|
|
||||||
type: master
|
|
||||||
|
|
||||||
upss:
|
|
||||||
- name: fooUPS
|
|
||||||
driver: usbhid-ups
|
|
||||||
port: auto
|
|
||||||
desc: "Foo UPS"
|
|
||||||
vendorid: 1111
|
|
||||||
productid: 1111
|
|
||||||
|
|
||||||
upsmon_servers:
|
|
||||||
- ups_name: fooUPS
|
|
||||||
address: localhost
|
|
||||||
user: upsmonitor
|
|
||||||
password: upsmonitorpass
|
|
||||||
type: "master"
|
|
||||||
|
|
||||||
|
@ -4,8 +4,3 @@
|
|||||||
service:
|
service:
|
||||||
name: nut-server
|
name: nut-server
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: restart nut-monitor
|
|
||||||
service:
|
|
||||||
name: nut-monitor
|
|
||||||
state: restarted
|
|
||||||
|
@ -7,10 +7,9 @@
|
|||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/nut/nut.conf
|
path: /etc/nut/nut.conf
|
||||||
regexp: '^MODE='
|
regexp: '^MODE='
|
||||||
line: MODE=netserver
|
line: MODE=standalone
|
||||||
notify: restart nut-server
|
notify: restart nut-server
|
||||||
|
|
||||||
# List of connected ups
|
|
||||||
- name: Copy ups.conf
|
- name: Copy ups.conf
|
||||||
template:
|
template:
|
||||||
src: ups.conf.j2
|
src: ups.conf.j2
|
||||||
@ -19,43 +18,3 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart nut-server
|
notify: restart nut-server
|
||||||
|
|
||||||
# Service that communicate with UPSs
|
|
||||||
- name: Copy upsd.conf
|
|
||||||
template:
|
|
||||||
src: upsd.conf.j2
|
|
||||||
dest: /etc/nut/upsd.conf
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart nut-server
|
|
||||||
|
|
||||||
# List of users allowed to communicate with upsd through network
|
|
||||||
- name: Copy upsd.users
|
|
||||||
template:
|
|
||||||
src: upsd.users.j2
|
|
||||||
dest: /etc/nut/upsd.users
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart nut-server
|
|
||||||
|
|
||||||
# Nut mode
|
|
||||||
- name: Copy nut.conf
|
|
||||||
template:
|
|
||||||
src: nut.conf.j2
|
|
||||||
dest: /etc/nut/nut.conf
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart nut-server
|
|
||||||
|
|
||||||
# Service that interact with upsd to act
|
|
||||||
- name: Copy upsmon.conf
|
|
||||||
template:
|
|
||||||
src: upsmon.conf.j2
|
|
||||||
dest: /etc/nut/upsmon.conf
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart nut-monitor
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
MODE={{ nut_mode }}
|
|
@ -4,7 +4,4 @@ maxretry = 3
|
|||||||
[{{ ups.name }}]
|
[{{ ups.name }}]
|
||||||
driver = {{ ups.driver }}
|
driver = {{ ups.driver }}
|
||||||
port = {{ ups.port }}
|
port = {{ ups.port }}
|
||||||
desc = {{ ups.desc }}
|
|
||||||
vendorid = {{ ups.vendorid }}
|
|
||||||
productid = {{ ups.productid }}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
MAXAGE 3
|
|
||||||
{% if nut_mode == "standalone" %}
|
|
||||||
LISTEN 127.0.0.1 3493
|
|
||||||
{% else %}
|
|
||||||
LISTEN 0.0.0.0 3493
|
|
||||||
{% endif %}
|
|
||||||
MAXCONN 2
|
|
@ -1,6 +0,0 @@
|
|||||||
{% for user in upsd_users %}
|
|
||||||
[{{ user.name }}]
|
|
||||||
password = {{ user.password}}
|
|
||||||
upsmon {{ user.type }}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
@ -1,24 +0,0 @@
|
|||||||
{% for server in upsmon_servers %}
|
|
||||||
MONITOR {{ server.ups_name }}@{{ server.address}} 1 {{ server.user }} {{ server.password }} "{{ server.type }}"
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
MINSUPPLIES 1
|
|
||||||
|
|
||||||
FINALDELAY 5
|
|
||||||
SHUTDOWNCMD "/sbin/shutdown -h +0"
|
|
||||||
------------------------------------------------
|
|
||||||
# POLLFREQ <n>
|
|
||||||
# Fréquence d'interrogation en secondes en fonctionnement normal de l'onduleur.
|
|
||||||
# La valeur par défaut est de 5 secondes.
|
|
||||||
POLLFREQ 5
|
|
||||||
------------------------------------------------
|
|
||||||
# POLLFREQALERT <n>
|
|
||||||
# Fréquence d'interrogation en secondes pendant que l'onduleur est sur batterie.
|
|
||||||
# La valeur par défaut est de 5 secondes.
|
|
||||||
POLLFREQALERT 5
|
|
||||||
------------------------------------------------
|
|
||||||
HOSTSYNC 15
|
|
||||||
DEADTIME 15
|
|
||||||
POWERDOWNFLAG /etc/killpower
|
|
||||||
RBWARNTIME 43200
|
|
||||||
NOCOMMWARNTIME 300
|
|
@ -15,10 +15,6 @@
|
|||||||
chdir: "/home/{{ user.username }}/.dotfiles"
|
chdir: "/home/{{ user.username }}/.dotfiles"
|
||||||
with_items: "{{ user.config.stowing }}"
|
with_items: "{{ user.config.stowing }}"
|
||||||
|
|
||||||
- name: init tmux
|
|
||||||
import_tasks: tmux.yml
|
|
||||||
when: '"tmux" in user.config.stowing'
|
|
||||||
|
|
||||||
- name: init neovim
|
- name: init neovim
|
||||||
import_tasks: neovim.yml
|
import_tasks: neovim.yml
|
||||||
when: '"nvim" in user.config.stowing'
|
when: '"nvim" in user.config.stowing'
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
- xdg-desktop-portal-wlr
|
- xdg-desktop-portal-wlr
|
||||||
- wl-clipboard
|
- wl-clipboard
|
||||||
- gobject-introspection # for avizo
|
- gobject-introspection # for avizo
|
||||||
- autotiling-rs
|
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install sway AUR packages
|
- name: Install sway AUR packages
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Install tmux
|
|
||||||
community.general.pacman:
|
|
||||||
name: tmux
|
|
||||||
state: present
|
|
||||||
when: ansible_os_family == "Archlinux"
|
|
||||||
|
|
||||||
- name: Install tmux
|
|
||||||
apt:
|
|
||||||
name: tmux
|
|
||||||
state: present
|
|
||||||
when: ansible_os_family == "Debian"
|
|
||||||
|
|
||||||
- name: Install tpm
|
|
||||||
ansible.builtin.git:
|
|
||||||
repo: "https://github.com/tmux-plugins/tpm"
|
|
||||||
dest: "/home/{{ user.username }}/.tmux/plugins/tpm"
|
|
||||||
depth: 1
|
|
||||||
become: true
|
|
||||||
become_user: "{{ user.username }}"
|
|
@ -34,16 +34,11 @@ pacman_cli:
|
|||||||
- moc
|
- moc
|
||||||
- pass
|
- pass
|
||||||
- task
|
- task
|
||||||
|
- neomutt
|
||||||
- youtube-dl
|
- youtube-dl
|
||||||
- neovim
|
- neovim
|
||||||
- python-pynvim
|
- python-pynvim
|
||||||
- dialog
|
- dialog
|
||||||
- neomutt
|
|
||||||
- vdirsyncer
|
|
||||||
- khard
|
|
||||||
- khal
|
|
||||||
- offlineimap
|
|
||||||
- msmtp
|
|
||||||
|
|
||||||
pacman_terms:
|
pacman_terms:
|
||||||
- rxvt-unicode
|
- rxvt-unicode
|
||||||
|
@ -18,9 +18,9 @@ borg_source_directories: "{{ nfs_shares | map(attribute='mount_point') }}"
|
|||||||
borg_repository: /backup/borgmatic
|
borg_repository: /backup/borgmatic
|
||||||
borgmatic_hooks:
|
borgmatic_hooks:
|
||||||
on_error:
|
on_error:
|
||||||
- "curl -X POST -d '{\"body\": \"Erreur dans le backup\"}' -H \"Content-Type: application/json\" http://apprise.nas.lan/notify/backup"
|
- echo "`date` - Error while creating a backup."
|
||||||
before_backup:
|
before_backup:
|
||||||
- "curl -X POST -d '{\"body\": \"Starting Backup\"}' -H \"Content-Type: application/json\" http://apprise.nas.lan/notify/backup"
|
- echo "`date` - Starting backup."
|
||||||
after_backup:
|
after_backup:
|
||||||
- "curl -X POST -d '{\"body\": \"Finished Backup\"}' -H \"Content-Type: application/json\" http://apprise.nas.lan/notify/backup"
|
- echo "`date` - Finished backup."
|
||||||
- poweroff
|
- poweroff
|
||||||
|
16
vars/nas.yml
16
vars/nas.yml
@ -13,26 +13,10 @@ pihole_docker_image: pihole/pihole:2022.05
|
|||||||
pihole_ip: 192.168.2.202
|
pihole_ip: 192.168.2.202
|
||||||
|
|
||||||
# Nut
|
# Nut
|
||||||
nut_mode: "netserver"
|
|
||||||
upsd_users:
|
|
||||||
- name: upsmonitor
|
|
||||||
password: "{{ ups_user_password }}"
|
|
||||||
type: master
|
|
||||||
|
|
||||||
upss:
|
upss:
|
||||||
- name: eaton650
|
- name: eaton650
|
||||||
driver: usbhid-ups
|
driver: usbhid-ups
|
||||||
port: auto
|
port: auto
|
||||||
vendorid: "0463"
|
|
||||||
productid: "FFFF"
|
|
||||||
desc: "UPS bureau"
|
|
||||||
|
|
||||||
upsmon_servers:
|
|
||||||
- ups_name: eaton650
|
|
||||||
address: localhost
|
|
||||||
user: upsmonitor
|
|
||||||
password: "{{ ups_user_password }}"
|
|
||||||
type: "master"
|
|
||||||
|
|
||||||
# minidlna
|
# minidlna
|
||||||
minidlna_friendly_name: "Nas dlna"
|
minidlna_friendly_name: "Nas dlna"
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
$ANSIBLE_VAULT;1.1;AES256
|
|
||||||
62323338353830396465343361333965643662633066633137313939363934353430633662336134
|
|
||||||
6265363735393134646561333137376430646362303264370a353861636430613264336238306439
|
|
||||||
65343362323638333736363164333665393965363539643463663936656239396438663139393862
|
|
||||||
6435396666663066620a386665313135613863616437386433616662396638646265663465633834
|
|
||||||
38346436383033613338393536326536393230633866666565393137333430623839623965623761
|
|
||||||
3934636264626337653762386531353861633338343364643335
|
|
Loading…
Reference in New Issue
Block a user