Update to buster and mount exfat USB

This commit is contained in:
Wojciech Kozlowski 2019-08-02 22:55:15 +02:00
parent e9926f7a02
commit b6bec6030e

View File

@ -5,7 +5,7 @@
- secrets.yml - secrets.yml
vars: vars:
- debian_release: stretch - debian_release: buster
- loki_dir: /srv/loki - loki_dir: /srv/loki
tasks: tasks:
@ -22,20 +22,8 @@
force_apt_get: yes force_apt_get: yes
register: apt_update register: apt_update
# Once ansible 2.7 is available will be able to just use reboot module. - name: Reboot the machine
- block: reboot:
- name: Reboot
shell: "sleep 1 && reboot"
async: 1
poll: 0
- name: Wait for host to come back up
wait_for_connection:
connect_timeout: 20
sleep: 5
delay: 5
timeout: 300
when: apt_update is changed when: apt_update is changed
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
@ -60,14 +48,31 @@
state: started state: started
enabled: yes enabled: yes
# -------------------------------------------------------------------------
# Set up the exfat file system for the USB flash drive.
# -------------------------------------------------------------------------
- name: Set up exfat
apt:
name: exfat-fuse
- name: Create USB mount directory
file:
path: /media/usb0
state: directory
- name: Ensure USB drive is auto-mounted
lineinfile:
line: "UUID=64A5-F009 /media/usb0 exfat defaults 0 0"
dest: "/etc/fstab"
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Apparmor. # Apparmor.
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- name: Install apparmor, utilities, and profiles - name: Install apparmor, utilities, and profiles
apt: apt:
name: "{{ item }}" name:
with_items:
- apparmor - apparmor
- apparmor-utils - apparmor-utils
- apparmor-profiles - apparmor-profiles
@ -92,17 +97,8 @@
- name: Update grub - name: Update grub
command: update-grub command: update-grub
- name: Reboot - name: Reboot the machine
shell: "sleep 1 && reboot" reboot:
async: 1
poll: 0
- name: Wait for host to come back up
wait_for_connection:
connect_timeout: 20
sleep: 5
delay: 5
timeout: 300
when: when:
apparmor is changed or apparmor is changed or
@ -139,8 +135,7 @@
- name: Install postfix - name: Install postfix
apt: apt:
name: "{{ item }}" name:
with_items:
- postfix - postfix
- ca-certificates - ca-certificates
- libsasl2-modules - libsasl2-modules
@ -232,8 +227,7 @@
- name: Install logcheck and logrotate - name: Install logcheck and logrotate
apt: apt:
name: "{{ item }}" name:
with_items:
- logcheck - logcheck
- logrotate - logrotate
@ -314,8 +308,7 @@
- name: Install rkhunter and chkrootkit - name: Install rkhunter and chkrootkit
apt: apt:
name: "{{ item }}" name:
with_items:
- rkhunter - rkhunter
- chkrootkit - chkrootkit
@ -358,8 +351,7 @@
- name: Install packages to enable HTTPS repository - name: Install packages to enable HTTPS repository
apt: apt:
name: "{{ item }}" name:
with_items:
- apt-transport-https - apt-transport-https
- ca-certificates - ca-certificates
- curl - curl
@ -386,8 +378,7 @@
- name: Install docker-ce and docker-compose - name: Install docker-ce and docker-compose
apt: apt:
name: "{{ item }}" name:
with_items:
- docker-ce - docker-ce
- docker-compose - docker-compose