Merge pull request 'Collected suggestions: Moving things around' (!57) from alex/netz39-infra-ansible:moving-things into master
Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/57 Reviewed-by: tux <tux@netz39.de>
This commit is contained in:
commit
6ba2737522
4 changed files with 47 additions and 42 deletions
12
README.md
12
README.md
|
@ -1,14 +1,10 @@
|
|||
# Ansible configuration for the Netz39 infrastructure
|
||||
|
||||
Currently including the following hosts:
|
||||
This call lists all hosts defined in the inventory:
|
||||
|
||||
* tau.netz39.de
|
||||
* pottwal.n39.eu
|
||||
* unicorn.n39.eu
|
||||
* platon.n39.eu
|
||||
* radon.n39.eu
|
||||
* krypton.n39.eu
|
||||
* oganesson.n39.eu
|
||||
```bash
|
||||
ansible -i inventory.yml all --list-hosts
|
||||
```
|
||||
|
||||
## Setup
|
||||
```bash
|
||||
|
|
38
all.yml
Normal file
38
all.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
# tasks for all hosts
|
||||
|
||||
- hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
|
||||
roles:
|
||||
- role: ansible.timezone
|
||||
|
||||
tasks:
|
||||
- name: Update and clean package cache
|
||||
apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
autoclean: true
|
||||
changed_when: false
|
||||
|
||||
- name: Ensure unattended-upgrades is installed and up to date
|
||||
apt:
|
||||
name: unattended-upgrades
|
||||
state: present
|
||||
|
||||
- name: Setup unattended-upgrades
|
||||
include_role:
|
||||
name: ansible-role-unattended-upgrades
|
||||
vars:
|
||||
unattended_origins_patterns:
|
||||
- "origin=Debian,archive=buster-security"
|
||||
- "o=Debian,a=buster-updates"
|
||||
unattended_package_blacklist: [cowsay]
|
||||
unattended_mail: "root"
|
||||
|
||||
- name: Setup users
|
||||
include_role:
|
||||
name: users
|
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
|
@ -0,0 +1,2 @@
|
|||
[defaults]
|
||||
inventory=inventory.yml
|
37
main.yml
37
main.yml
|
@ -1,39 +1,8 @@
|
|||
---
|
||||
- hosts: all
|
||||
become: true
|
||||
# main playbook aggregating all the other playbooks
|
||||
|
||||
vars:
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
|
||||
roles:
|
||||
- role: ansible.timezone
|
||||
|
||||
tasks:
|
||||
- name: Update and clean package cache
|
||||
apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
autoclean: true
|
||||
changed_when: false
|
||||
|
||||
- name: Ensure unattended-upgrades is installed and up to date
|
||||
apt:
|
||||
name: unattended-upgrades
|
||||
state: present
|
||||
|
||||
- name: Setup unattended-upgrades
|
||||
include_role:
|
||||
name: ansible-role-unattended-upgrades
|
||||
vars:
|
||||
unattended_origins_patterns:
|
||||
- "origin=Debian,archive=buster-security"
|
||||
- "o=Debian,a=buster-updates"
|
||||
unattended_package_blacklist: [cowsay]
|
||||
unattended_mail: "root"
|
||||
|
||||
- name: Setup users
|
||||
include_role:
|
||||
name: users
|
||||
- name: Setup for all hosts
|
||||
import_playbook: all.yml
|
||||
|
||||
- name: Specific setup for all proxmox hosts
|
||||
import_playbook: proxmox.yml
|
||||
|
|
Loading…
Reference in a new issue