From 1d8311df92d7e66d433eb8e82028abae99035a0b Mon Sep 17 00:00:00 2001 From: Antoine Le Morvan Date: Mon, 6 Dec 2021 11:38:58 +0100 Subject: [PATCH 1/2] New way to generate a config file --- docs/books/learning_ansible/01-basic.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/books/learning_ansible/01-basic.md b/docs/books/learning_ansible/01-basic.md index 91bc6814ee..22f09c094a 100644 --- a/docs/books/learning_ansible/01-basic.md +++ b/docs/books/learning_ansible/01-basic.md @@ -142,9 +142,31 @@ An example of the `ansible.cfg` [is given here](https://github.com/ansible/ansib $ sudo mkdir /etc/ansible $ sudo curl -o /etc/ansible/ansible.cfg https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg $ sudo curl -o /etc/ansible/hosts https://raw.githubusercontent.com/ansible/ansible/devel/examples/hosts +``` + +You can also use the `ansible-config` command to generate a new configuration file : + +``` +usage: ansible-config [-h] [--version] [-v] {list,dump,view,init} ... + +View ansible configuration. +positional arguments: + {list,dump,view,init} + list Print all config options + dump Dump configuration + view View configuration file + init Create initial configuration ``` +Example: + +``` +ansible-config init --disabled > /etc/ansible/ansible.cfg +``` + +The `--disabled` option allows you to comment out the set of options by prefixing them with a `;`. + ### The inventory file `/etc/ansible/hosts` As Ansible will have to work with all your equipment to be configured, it is very important to provide it with one (or more) well-structured inventory file(s), which perfectly matches your organization. From 0aa402e9ad178a99161803e87c54b2e974301fe2 Mon Sep 17 00:00:00 2001 From: Steven Spencer Date: Mon, 6 Dec 2021 09:02:12 -0600 Subject: [PATCH 2/2] Edit 414 summary * Update meta data * fix colon out of place --- docs/books/learning_ansible/01-basic.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/books/learning_ansible/01-basic.md b/docs/books/learning_ansible/01-basic.md index 22f09c094a..ee8a9a665b 100644 --- a/docs/books/learning_ansible/01-basic.md +++ b/docs/books/learning_ansible/01-basic.md @@ -1,5 +1,8 @@ --- title: Ansible Basics +author: Antoine Le Morvan +contributors: Steven Spencer +update: 12-06-2021 --- # Ansible Basics @@ -144,7 +147,7 @@ $ sudo curl -o /etc/ansible/ansible.cfg https://raw.githubusercontent.com/ansibl $ sudo curl -o /etc/ansible/hosts https://raw.githubusercontent.com/ansible/ansible/devel/examples/hosts ``` -You can also use the `ansible-config` command to generate a new configuration file : +You can also use the `ansible-config` command to generate a new configuration file: ``` usage: ansible-config [-h] [--version] [-v] {list,dump,view,init} ...