Configure Linux: aliases, apparmor, authorized keys, automatic upgrades, bluetooth, cron, gpsd, grub, hostname, hosts, iptables, latex, lid, logrotate, modem manager, modules, netplan, nfsd, packages, pm-utils, postfix, repos, smart, speech-dispatcher, ssh, sshd, sudoers, swap, sysctl, timesyncd, timezone, udev, users, virtualbox, wpa_gui, wpa_supplicant, xen, xorg.conf.d, (wip ...)
Tested with Ubuntu 18.04. Some tasks tested with CentOS 7.
None.
Read the defaults and examples in vars.
- Install the role.
# ansible-galaxy install vbotka.linux_postinstall
- Change variables.
# editor vbotka.linux_postinstall/vars/main.yml
- Create the inventory.
# cat hosts
[host1]
host1.example.com
[host1:vars]
ansible_connection=ssh
ansible_user=root
ansible_python_interpreter=/usr/bin/python2.7
ansible_perl_interpreter=/usr/bin/perl
- Create the playbook.
# cat linux-postinstall.yml
- hosts: host1
roles:
- vbotka.linux_postinstall
- Run the playbook.
# ansible-playbook linux-postinstall.yml
Perform syntax check of the playbook
# ansible-playbook linux-postinstall.yml --syntax-check
Run the playbook in in check mode first
# ansible-playbook linux-postinstall.yml --check
If all is right run the playbook twice. In second run all tasks shall be OK and 0 changed, unreachable and failed.
# ansible-playbook linux-postinstall.yml
- Configure users, sudoers and persistent network interfaces
# ansible-playbook linux-postinstall.yml -t lp_users
# ansible-playbook linux-postinstall.yml -t lp_sudoers
# ansible-playbook linux-postinstall.yml -t lp_udev
-
Reboot
-
Configure iptables
# ansible-playbook linux-postinstall.yml -t lp_iptables
-
Configure network connection
-
Configure other tasks
# ansible-playbook linux-postinstall.yml