Digital Ocean & Ansible
4 | Written on Mon 15 June 2020. Posted in Tutorials | Richard Walker

Working with Digital Ocean's API and Ansible.
Read more4 | Written on Mon 15 June 2020. Posted in Tutorials | Richard Walker
Working with Digital Ocean's API and Ansible.
Read more3 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
Ansible can be configured to log its output to log files through the log_path parameter in the default section of the ansible.cfg
configuration file.
The debug
module provides insight into what is happening in the play.
Example:
- name: Display free memory
debug:
msg: "Free memory for this …
9 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
The yum
Ansible module uses the Yum Package Manager on the managed hosts to handle the package operations.
The following example is equivalent to yum install httpd
- name: Install httpd
yum:
name: httpd
state: present
Run the ansible-doc yum
command for additional parameters and playbook examples.
The package_facts …
5 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
Ansible roles provide a way for you to make it easier to reuse Ansible code generically. A well-written role will allow you to pass variables to the role from the playbook that adjust its behavior, setting all the site-specific hostnames, IP addresses, user names, secrets, or other locally-specific details you …
Read more6 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
Host patterns are used to specify the hosts to target by a play. At its most basic the name of a managed host or a host group in the inventory is a host pattern.
Hosts can be defined using hostname or IP address and must …
Read more1 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
Ansible uses the Jinja2 templating system for template files.
Variables and logic expressions are placed between tags, or delimiters.
Jinja2 templates use {% EXPR %}
for expressions or logic.
{{ EXPR }}
are used for outputting the results of an expression or a variable.
A Jinja2 template is composed of multiple elements: data, variables …
Read more2 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
The Files
modules library includes modules allowing you to accomplish most tasks related to Linux file management, such as creating, copying, editing, and modifying permissions and other attributes of files.
Common files modules include blockinfile
,copy
,fetch
,file
,lineinfile
, stat
and synchronize
.
Use the file
module to touch
a file …
1 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
Ansible evaluates the return code of each task to determine whether the task succeeded or failed. There are a number of Ansible features that can be used to manage task errors.
By default, if a task fails, the play is aborted. You can use the ignore_errors
keyword …
1 | Written on Tue 11 February 2020. Posted in Nuggets | Richard Walker
Ansible modules are designed to be idempotent. This means that in a properly written playbook, the playbook and its tasks can be run multiple times without changing the managed host unless they need to make a change to get the managed host to the desired state.
Handlers are tasks that …
Read more(Page 1 / 3) Next