Commit 27be5e75 authored by Freezed's avatar Freezed 🇫🇷
Browse files

Add home network configuration 🔧

parent b6a1d55b
......@@ -14,4 +14,8 @@ open_all:
${EDITOR} ./roles/debian/files/vimrc
${EDITOR} ./roles/debian/files/zsh/*
${EDITOR} ./roles/debian/tasks/*.yml
${EDITOR} ./roles/debian/vars/*.yml
${EDITOR} ./roles/log/tasks/*.yml
${EDITOR} ./roles/log/templates/*.j2
${EDITOR} ./roles/mailer/tasks/*.yml
${EDITOR} ./roles/mailer/templates/*.j2
${EDITOR} ./roles/mailer/vars/*.yml
[vdeb]
192.168.0.1
[physical]
localhost
192.168.1.70
192.168.1.71
192.168.1.73
192.168.1.93
[test]
192.168.0.2
[virtual]
192.168.1.77
192.168.1.66
[server]
192.168.1.71
192.168.1.77
192.168.1.66
[workstation]
localhost
192.168.1.70
192.168.1.73
192.168.1.93
......@@ -42,12 +42,13 @@
state: present
create: yes
- name: Add repository "{{ debian_version_name }}-backports"
- name: Add repository "{{ debian_stable_release_name }}-backports"
become: no
when: ansible_distribution_major_version == debian_stable_release_name
apt_repository:
repo: "deb http://ftp.debian.org/debian {{ debian_version_name }}-backports main"
repo: "deb http://ftp.debian.org/debian {{ debian_stable_release_name }}-backports main"
state: present
filename: "{{ debian_version_name }}-backports"
filename: "{{ debian_stable_release_name }}-backports"
- name: Upgrade all packages to the latest version
become: no
......@@ -83,9 +84,9 @@
src: gitconfig
dest: /home/{{ debian_user }}/.gitconfig
- name: "Set shell to zsh for «ansible_ssh_user»"
- name: "Set shell to zsh for «{{ debian_user }}»"
become: no
user:
name: "{{ ansible_ssh_user }}"
name: "{{ debian_user }}"
shell: /bin/zsh
state: present
---
debian_version_name: buster
debian_user: deployer
---
- name: Set permission of "/srv/"
file:
path: /srv/
group: staff
- name: Usage file
template:
src: usage.j2
dest: /srv/.usage
- name: Set permission of "/srv/.usage"
file:
path: /srv/.usage
owner: root
group: staff
mode: '0640'
{{ server_usage }}
-------------------
System ({{ ansible_distribution_major_version }}) updated {{ ansible_date_time.date }} @ {{ ansible_date_time.time }}
---
- name: "Send report to {{ mailer_to }}, cc {{ mailer_cc }}"
mail:
host: smtp.domain.tld
port: 25
charset: utf8
timeout: 40
from: "{{ mailer_from }}"
to: "{{ mailer_to }}"
cc: "{{ mailer_cc }}"
subject: "{{ subject }}"
body: "{{ lookup('template', 'roles/mailer/templates/body.j2') }}"
(Ceci est un message automatique, pardonnez la formulation)
Bonjour,
La machine «{{ ansible_hostname }}» ({{ ansible_default_ipv4.address }}) vient d'être mise à jour.
Distribution :{{ ansible_distribution }}/{{ ansible_distribution_major_version }} (v{{ ansible_distribution_major_version }})
___
Horodatage : {{ ansible_date_time.date }} @ {{ ansible_date_time.time }}
---
mailer_cc: "user@domain.tld"
mailer_from: "user@domain.tld"
mailer_to: "user@domain.tld"
subject: "[auto] Mise à jour {{ ansible_hostname }}/{{ ansible_default_ipv4.address }}"
......@@ -3,15 +3,16 @@
become: no
become_user: "{{ debian_user }}"
become_method: su
gather_facts: false
gather_facts: true
remote_user: root
hosts:
- vdeb
- test
hosts: all
vars:
server_usage: "A basic `Debian/{{ debian_version_name }}` config"
debian_user: foobar
server_usage: "Debian config for home, dev & server usage"
roles:
- debian
- log
- mailer
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment