Answer the question
In order to leave comments, you need to log in
Best practice in writing Ansible Playbook?
Colleagues, hello.
I started writing playbooks with ansible, I have a couple of questions about best practice in writing playbooks.
1. I have a 250-line playbook (small, yes), but now I look at other people's playbooks and see that colleagues create roles instead of one continuous text. How do you think it should be done? For example, I will show my part of the playbook:
- name: STAGE 0.0.8 - Install prerequisites
apt:
name: "{{items}}"
#update_cache: yes
vars:
items:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- net-tools
- name: STAGE 0.0.9 - Set swap to 1 value
sysctl:
name: vm.swappiness
value: 1
state: present
# ---------
- name: STAGE 0.1 - Add the user '' with a primary group of 'sudo and admin'
user:
name: r
shell: /bin/bash
groups:
- sudo
state: present
password: '6$$.'
createhome: yes
Answer the question
In order to leave comments, you need to log in
Best practices
Add float: left; to the .inner1 block and the blocks will stand up normally
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question