Add hosts and move vars into var files
This commit is contained in:
parent
1b68766cd6
commit
a2b6301fad
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,4 +3,5 @@
|
||||||
.vagrant/
|
.vagrant/
|
||||||
*.log
|
*.log
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
||||||
venv/
|
venv/
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[production]
|
|
||||||
hevonen.servers.data.coop ansible_port=19022
|
|
||||||
|
|
||||||
[monitoring]
|
|
||||||
uptime.data.coop
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
users:
|
users:
|
||||||
- name: graffen
|
- name: graffen
|
||||||
|
|
13
group_vars/monitoring/vars.yml
Normal file
13
group_vars/monitoring/vars.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
vagrant: "{{ from_vagrant is defined and from_vagrant }}"
|
||||||
|
letsencrypt_enabled: "{{ not vagrant }}"
|
||||||
|
|
||||||
|
base_domain: "{{ 'datacoop.devel' if vagrant else 'data.coop' }}"
|
||||||
|
letsencrypt_email: admin@data.coop
|
||||||
|
|
||||||
|
services_include:
|
||||||
|
- nginx_proxy
|
||||||
|
- uptime_kuma
|
||||||
|
- watchtower
|
16
group_vars/production/vars.yml
Normal file
16
group_vars/production/vars.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ldap_dn: "dc=data,dc=coop"
|
||||||
|
|
||||||
|
vagrant: "{{ from_vagrant is defined and from_vagrant }}"
|
||||||
|
letsencrypt_enabled: "{{ not vagrant }}"
|
||||||
|
|
||||||
|
base_domain: "{{ 'datacoop.devel' if vagrant else 'data.coop' }}"
|
||||||
|
letsencrypt_email: admin@data.coop
|
||||||
|
|
||||||
|
smtp_host: "postfix"
|
||||||
|
smtp_port: "587"
|
||||||
|
|
||||||
|
services_exclude:
|
||||||
|
- uptime_kuma
|
16
group_vars/staging/vars.yml
Normal file
16
group_vars/staging/vars.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ldap_dn: "dc=staging,dc=data,dc=coop"
|
||||||
|
|
||||||
|
vagrant: "{{ from_vagrant is defined and from_vagrant }}"
|
||||||
|
letsencrypt_enabled: "{{ not vagrant }}"
|
||||||
|
|
||||||
|
base_domain: "{{ 'staging.datacoop.devel' if vagrant else 'staging.data.coop' }}"
|
||||||
|
letsencrypt_email: admin@data.coop
|
||||||
|
|
||||||
|
smtp_host: "postfix"
|
||||||
|
smtp_port: "587"
|
||||||
|
|
||||||
|
services_exclude:
|
||||||
|
- uptime_kuma
|
5
host_vars/cavall.yml
Normal file
5
host_vars/cavall.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ansible_host: 85.209.118.134
|
||||||
|
fqdn: cavall.servers.data.coop
|
6
host_vars/folald.yml
Normal file
6
host_vars/folald.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ansible_host: 85.209.118.134
|
||||||
|
ansible_port: 19022
|
||||||
|
fqdn: folald.vm.cavall.servers.data.coop
|
5
host_vars/hestur.yml
Normal file
5
host_vars/hestur.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ansible_host: 159.223.17.241
|
||||||
|
fqdn: hestur.servers.data.coop
|
6
host_vars/poltre.yml
Normal file
6
host_vars/poltre.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ansible_host: 85.209.118.142
|
||||||
|
ansible_port: 19022
|
||||||
|
fqdn: poltre.vm.cavall.servers.data.coop
|
6
host_vars/varsa.yml
Normal file
6
host_vars/varsa.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
|
---
|
||||||
|
ansible_host: 85.209.118.143
|
||||||
|
ansible_port: 19022
|
||||||
|
fqdn: varsa.vm.cavall.servers.data.coop
|
19
inventory.ini
Normal file
19
inventory.ini
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
[proxmox]
|
||||||
|
cavall
|
||||||
|
|
||||||
|
[monitoring]
|
||||||
|
hestur
|
||||||
|
|
||||||
|
[production]
|
||||||
|
poltre
|
||||||
|
|
||||||
|
[staging]
|
||||||
|
varsa
|
||||||
|
|
||||||
|
[control]
|
||||||
|
folald
|
||||||
|
|
||||||
|
[virtual:children]
|
||||||
|
production
|
||||||
|
staging
|
||||||
|
control
|
18
playbook.yml
18
playbook.yml
|
@ -1,23 +1,9 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- hosts: production
|
- hosts: all
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
become: true
|
become: true
|
||||||
vars:
|
|
||||||
ldap_dn: "dc=data,dc=coop"
|
|
||||||
|
|
||||||
vagrant: "{{ from_vagrant is defined and from_vagrant }}"
|
|
||||||
letsencrypt_enabled: "{{ not vagrant }}"
|
|
||||||
|
|
||||||
base_domain: "{{ 'datacoop.devel' if vagrant else 'data.coop' }}"
|
|
||||||
letsencrypt_email: "admin@{{ base_domain }}"
|
|
||||||
|
|
||||||
smtp_host: "postfix"
|
|
||||||
smtp_port: "587"
|
|
||||||
|
|
||||||
services_exclude:
|
|
||||||
- uptime_kuma
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- import_role:
|
- import_role:
|
||||||
name: ubuntu_base
|
name: ubuntu_base
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
volume_root_folder: "/docker-volumes"
|
volume_root_folder: "/docker-volumes"
|
||||||
volume_website_folder: "{{ volume_root_folder }}/websites"
|
volume_website_folder: "{{ volume_root_folder }}/websites"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: restart nginx
|
- name: restart nginx
|
||||||
command: docker compose restart proxy
|
command: docker compose restart proxy
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create volume folder for service {{ service.name }}
|
- name: Create volume folder for service {{ service.name }}
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Add Docker PGP key
|
- name: Add Docker PGP key
|
||||||
apt_key:
|
apt_key:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Generate htpasswd file
|
- name: Generate htpasswd file
|
||||||
shell: docker compose exec registry htpasswd -Bbn docker {{ docker_password }} > auth/htpasswd
|
shell: docker compose exec registry htpasswd -Bbn docker {{ docker_password }} > auth/htpasswd
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Configure cron job to remove old Mastodon media daily
|
- name: Configure cron job to remove old Mastodon media daily
|
||||||
cron:
|
cron:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Upload vhost config for root domain
|
- name: Upload vhost config for root domain
|
||||||
copy:
|
copy:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolder
|
- name: Create subfolder
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolder for Mastodon data
|
- name: Create subfolder for Mastodon data
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Set up network for Postfix
|
- name: Set up network for Postfix
|
||||||
docker_network:
|
docker_network:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolders
|
- name: Create subfolders
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolder
|
- name: Create subfolder
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create SSH directory
|
- name: Create SSH directory
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Create subfolder for MariaDB data
|
- name: Create subfolder for MariaDB data
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Set up external services network
|
- name: Set up external services network
|
||||||
docker_network:
|
docker_network:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Install necessary packages via apt
|
- name: Install necessary packages via apt
|
||||||
apt:
|
apt:
|
||||||
|
@ -10,8 +11,3 @@
|
||||||
- apparmor
|
- apparmor
|
||||||
- haveged
|
- haveged
|
||||||
- mosh
|
- mosh
|
||||||
|
|
||||||
- name: Install Dell OpenManage
|
|
||||||
apt:
|
|
||||||
name: srvadmin-all
|
|
||||||
when: not vagrant and not skip_dell_apt_repo
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
# vim: ft=yaml.ansible
|
|
||||||
---
|
|
||||||
- name: Import dell apt signing key
|
|
||||||
apt_key:
|
|
||||||
id: "1285491434D8786F"
|
|
||||||
keyserver: "keyserver.ubuntu.com"
|
|
||||||
|
|
||||||
- name: Configure dell apt repo
|
|
||||||
apt_repository:
|
|
||||||
repo: "deb https://linux.dell.com/repo/community/openmanage/10101/focal focal main"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Restrict dell apt repo"
|
|
||||||
copy:
|
|
||||||
dest: "/etc/apt/preferences.d/dell"
|
|
||||||
content: |
|
|
||||||
Explanation: Deny all packages from this repo that exist elsewhere
|
|
||||||
Package: *
|
|
||||||
Pin: origin "linux.dell.com"
|
|
||||||
Pin-Priority: 400
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Setup firewall with UFW
|
- name: Setup firewall with UFW
|
||||||
community.general.ufw:
|
community.general.ufw:
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- import_tasks: ssh-port.yml
|
- import_tasks: ssh-port.yml
|
||||||
tags: [change-ssh-port]
|
tags: [change-ssh-port]
|
||||||
when: not do_not_change_ssh_port
|
when: ansible_port != 22
|
||||||
|
|
||||||
- import_tasks: dell-apt-repo.yml
|
|
||||||
tags: [setup-dell-apt-repo]
|
|
||||||
when: not skip_dell_apt_repo and not vagrant
|
|
||||||
|
|
||||||
- import_tasks: upgrade.yml
|
- import_tasks: upgrade.yml
|
||||||
tags: [do-full-system-upgrade]
|
tags: [do-full-system-upgrade]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: Change SSH port on host
|
- name: Change SSH port on host
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: update and upgrade system via apt
|
- name: update and upgrade system via apt
|
||||||
apt:
|
apt:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- name: "Add users"
|
- name: "Add users"
|
||||||
user:
|
user:
|
||||||
|
|
|
@ -1,20 +1,10 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
|
# code: language=ansible
|
||||||
---
|
---
|
||||||
- hosts: monitoring
|
- hosts: monitoring
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
vagrant: false
|
|
||||||
base_domain: "{{ 'datacoop.devel' if vagrant else 'data.coop' }}"
|
|
||||||
letsencrypt_enabled: true
|
|
||||||
letsencrypt_email: "admin@{{ base_domain }}"
|
|
||||||
services_include:
|
|
||||||
- nginx_proxy
|
|
||||||
- uptime_kuma
|
|
||||||
- watchtower
|
|
||||||
do_not_change_ssh_port: true
|
|
||||||
skip_dell_apt_repo: true
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- import_role:
|
- import_role:
|
||||||
name: ubuntu_base
|
name: ubuntu_base
|
||||||
|
|
Loading…
Reference in a new issue