A first role
Notes// archive From the original Code Walker docs. Kept for reference, so some versions and commands may be out of date.
So, to start building some custom roles to manage a single EC2 instance, here is an example of tasks you may want to execute initially on a new instance.
mkdir -p roles/initialize/tasksroles/initialize/tasks/main.ymlyaml
---
# Update all packages
- name: Upgrade all packages
dnf:
name: "*"
state: latest
# Reboot server
- name: Reboot server
reboot:
reboot_timeout: 180