Skip to main content

Ansible

inventory.ini
[ubuntu_hosts]
my_host

[ubuntu_hosts:vars]
ansible_user=my_user

Apt Get Update

- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600

Apt Get Upgrade

- name: Upgrade all packages
apt:
upgrade: dist
autoremove: yes

Configure Inputrc

- name: Add custom inputrc content for ansible_user
copy:
dest: "~/.inputrc"
content: |
# arrow up
"\e[A":history-search-backward
# arrow down
"\e[B":history-search-forward
mode: "0644"

Restart

- name: Restart
reboot:

Shutdown

- name: Shutdown
command: shutdown now