Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
f0d65afd45 | |||
db06f882d6 |
6 changed files with 182 additions and 0 deletions
4
roles/stable/debian-base/files/sources.list
Normal file
4
roles/stable/debian-base/files/sources.list
Normal file
|
@ -0,0 +1,4 @@
|
|||
deb http://deb.debian.org/debian buster main contrib non-free
|
||||
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
|
||||
deb http://deb.debian.org/debian buster-updates main contrib non-free
|
||||
deb http://deb.debian.org/debian buster-backports main contrib non-free
|
45
roles/stable/debian-base/tasks/main.yml
Normal file
45
roles/stable/debian-base/tasks/main.yml
Normal file
|
@ -0,0 +1,45 @@
|
|||
- name: debian-base - Copia apt/sources.list completo
|
||||
copy:
|
||||
src: sources.list
|
||||
dest: /etc/apt/sources.list
|
||||
|
||||
- name: debian-base - Aggiorna indici apt-get
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
#- name: Aggiorna distro
|
||||
# apt:
|
||||
# upgrade: dist
|
||||
|
||||
- name: debian-base - Installa pacchetti sistema base
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items:
|
||||
- amd64-microcode
|
||||
- bmon
|
||||
- bzip2
|
||||
- ca-certificates
|
||||
- console-data
|
||||
- curl
|
||||
# - etckeeper
|
||||
- git
|
||||
- htop
|
||||
- intel-microcode
|
||||
- less
|
||||
- lnav
|
||||
- openssh-server
|
||||
- rar
|
||||
- screen
|
||||
- sudo
|
||||
- tree
|
||||
- unzip
|
||||
- unar
|
||||
- unrar
|
||||
- unattended-upgrades
|
||||
- vim
|
||||
- wget
|
||||
- zip
|
||||
- zsh
|
||||
|
||||
|
1
roles/stable/debian-frontend/files/apt-nginx.list
Normal file
1
roles/stable/debian-frontend/files/apt-nginx.list
Normal file
|
@ -0,0 +1 @@
|
|||
deb http://nginx.org/packages/debian/ buster nginx
|
4
roles/stable/debian-frontend/files/sources-debian.list
Normal file
4
roles/stable/debian-frontend/files/sources-debian.list
Normal file
|
@ -0,0 +1,4 @@
|
|||
deb http://deb.debian.org/debian buster main contrib non-free
|
||||
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
|
||||
deb http://deb.debian.org/debian buster-updates main contrib non-free
|
||||
deb http://deb.debian.org/debian buster-backports main contrib non-free
|
71
roles/stable/debian-frontend/tasks/main.yml
Normal file
71
roles/stable/debian-frontend/tasks/main.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
|
||||
- debug:
|
||||
msg: "Distro: {{ hostvars[inventory_hostname].ansible_distribution }} {{ hostvars[inventory_hostname].ansible_distribution_version }}"
|
||||
|
||||
- name: Copia apt/sources.list (Debian)
|
||||
when: ansible_distribution == "Debian"
|
||||
become: true
|
||||
copy:
|
||||
src: sources-debian.list
|
||||
dest: /etc/apt/sources.list
|
||||
|
||||
- name: Aggiorna indici apt-get
|
||||
become: true
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Installa pacchetti base dalla distro
|
||||
apt:
|
||||
name: [
|
||||
'amd64-microcode',
|
||||
'bmon',
|
||||
'bzip2',
|
||||
'ca-certificates',
|
||||
'console-data',
|
||||
'curl',
|
||||
'git',
|
||||
'htop',
|
||||
'intel-microcode',
|
||||
'less',
|
||||
'lnav',
|
||||
'rar',
|
||||
'screen',
|
||||
'sudo',
|
||||
'tree',
|
||||
'unzip',
|
||||
'unar',
|
||||
'unrar',
|
||||
'unattended-upgrades',
|
||||
'vim',
|
||||
'wget',
|
||||
'zip',
|
||||
'zsh',
|
||||
]
|
||||
state: latest
|
||||
update_cache: yes
|
||||
#TODO
|
||||
- name: Installa pacchetti webserver
|
||||
apt:
|
||||
name: [
|
||||
'apt-transport-https',
|
||||
'curl',
|
||||
'ca-certificates',
|
||||
'clamav',
|
||||
'clamav-freshclam',
|
||||
'gnupg2',
|
||||
'imagemagick',
|
||||
'jpegoptim',
|
||||
'libapache2-mod-rpaf',
|
||||
'optipng',
|
||||
'pngquant',
|
||||
'python3-pip',
|
||||
]
|
||||
default_release: ascii-backports
|
||||
state: latest
|
||||
default_release: ascii-backports
|
||||
|
||||
|
||||
|
||||
- include: nginx.yml
|
||||
|
57
roles/stable/debian-frontend/tasks/nginx.yml
Normal file
57
roles/stable/debian-frontend/tasks/nginx.yml
Normal file
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
|
||||
- name: Copia apt-nginx.list
|
||||
copy:
|
||||
src: apt-nginx.list
|
||||
dest: /etc/apt/sources.list.d/nginx.list
|
||||
|
||||
- name: Importa chiave gpg nginx.org
|
||||
apt_key:
|
||||
#id: ABF5BD827BD9BF62
|
||||
#id: 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
|
||||
url: https://nginx.org/keys/nginx_signing.key
|
||||
state: present
|
||||
|
||||
- name: Installa nginx.org
|
||||
apt:
|
||||
name: nginx
|
||||
state: latest
|
||||
install_recommends: yes
|
||||
update_cache: yes
|
||||
|
||||
- name: Installa certbot per nginx
|
||||
apt:
|
||||
name: python3-certbot-nginx
|
||||
state: latest
|
||||
install_recommends: yes
|
||||
|
||||
# TODO: importa o crea certificati letsencrypt, forse ridondante con roles/stable/nginx
|
||||
|
||||
#- name: Copia file configurazione nginx
|
||||
# copy:
|
||||
# src: "{{ item.origin }}"
|
||||
# dest: "/etc/nginx/{{ item.dest }}"
|
||||
# owner: root
|
||||
# group: root
|
||||
# mode: 0644
|
||||
# backup: yes
|
||||
# with_items:
|
||||
# - { origin: 'nginx/nginx.conf', dest: 'nginx.conf' }
|
||||
# - { origin: 'nginx/deny.conf', dest: 'deny.conf' }
|
||||
|
||||
#- name: Disabilita sito di default Nginx
|
||||
# file:
|
||||
# path: /etc/nginx/sites-enabled/default
|
||||
# state: absent
|
||||
|
||||
#- name: Crea directory per il sito
|
||||
# file:
|
||||
# path: /var/www/websites/
|
||||
# state: directory
|
||||
# mode: 0755
|
||||
|
||||
#- name: Abilita Nginx al boot, ma non avviarlo ancora (altrimenti crasha perchè mancano i certificati SSL)
|
||||
# service:
|
||||
# name: nginx
|
||||
# state: stopped
|
||||
# enabled: yes
|
Loading…
Reference in a new issue