Jörg Kastning
ansible
and ansible-core
?ansible | ansible-core |
---|---|
Includes language, runtime, and selected collections | Includes language, runtime, and buildin plugins |
Maintains only one version at a time | Maintains latest version plus two older versions |
Uses semantic versioning | Does not use semantic versioning (Don't ask why!) |
Flexible release cycle | Flexible release cycle |
roles/
common/ # this hierarchy represents a "role"
tasks/ #
main.yml # <-- tasks file can include smaller files if warranted
handlers/ #
main.yml # <-- handlers file
templates/ # <-- files for use with the template resource
ntp.conf.j2 # <------- templates end in .j2
files/ #
bar.txt # <-- files for use with the copy resource
foo.sh # <-- script files for use with the script resource
vars/ #
main.yml # <-- variables associated with this role
defaults/ #
main.yml # <-- default lower priority variables for this role
meta/ #
main.yml # <-- role dependencies
library/ # roles can also include custom modules
module_utils/ # roles can also include custom module_utils
lookup_plugins/ # or other types of plugins, like lookup in this case
webtier/ # same kind of structure as "common" was above, done for the webtier role
fooapp/ # ""
Docs: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
$ ansible-galaxy role init otto_glattermann
- Role otto_glattermann was created successfully
$ tree otto_glattermann/
otto_glattermann/
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── README.md
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
8 directories, 8 files
defaults/main.yml
and explain them in Readme.md
.
cat bits_init_baseline.yml
---
- hosts: hostname.example.com
Vars:
intitial_pw: "Change1T!"
# SSH-Pub-Keys for user 'ansibleadm'
sysadm_ssh_keys:
- /ssh_pub_keys/alice.pub
- /ssh_pub_keys/bob.pub
roles:
- set_proxy4rhsm
- register_syspurpose
- resolv.conf
- baseline_pkgs
- chrony
- postfix
- firewalld
- selinux
- sshmgmt_v1.5
- init-root-passwd