Skip to content
Main Menu
  • Home
  • Blog
  • Contact

DevOps Fu

Tips and Tricks for DevOps Engineers

  • Home
  • Blog
  • Contact

Tag: Ansible

  • Home
  • Blog
  • Ansible

How to install an old version of PHP using geerlingguy.php on Ubuntu target

November 23, 2018March 26, 2019 Fabrice

Your playbook should look like so: — – hosts: XYZ become: yes pre_tasks: – name: Add repository for old PHP apt_repository: repo: ppa:ondrej/php update_cache: yes state: present roles: – role: geerlingguy.apache … – role: geerlingguy.php php_webserver_daemon: apache2 php_default_version_debian: "7.1" php_version:… Read More

AutomationAnsible, PHPLeave a comment

How to convert a string to int in Jinja2?

August 23, 2018March 26, 2019 Fabrice

Simple: MYSTRING | int I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.

AutomationAnsible, Jinja2Leave a comment

How to extract an object from a list based on attribute value in Jinja2?

August 7, 2018March 23, 2019 Fabrice

Use the `selectattr()` filter. For example: – set_fact: myobj: "{{ hostvars[inventory_hostname].ansible_mounts | selectattr(‘mount’, ‘equalto’, ‘/’) | list }}" – debug: var=myobj I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t… Read More

AutomationAnsible, Jinja2Leave a comment

How to loop over a role in Ansible?

August 6, 2018March 23, 2019 Fabrice

Don’t use “roles:” but “tasks:” and use the include_role module. For example: — # roles/myrole/tasks/main.yml – debug: var=bla   — # playbook – hosts: localhost connection: local gather_facts: no tasks: – name: Loop over role include_role: name: myrole vars: bla:… Read More

AutomationAnsibleLeave a comment

How to install the latest version of Ansible on Ubuntu?

July 31, 2018March 23, 2019 Fabrice

From here, the steps are: $ sudo apt update $ sudo apt install software-properties-common $ sudo apt-add-repository ppa:ansible/ansible $ sudo apt update $ sudo apt install ansible I work as a freelancer, so if you don’t want to do that… Read More

SysadminAnsibleLeave a comment

Jinja2: How to iterate over a dictionary?

May 22, 2018March 25, 2019 Fabrice

{% for key, value in MYDICT.items() %} … {% endfor %} I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire… Read More

AutomationAnsible, Jinja2Leave a comment

How to generate a comma-separated list in Jinja2?

May 20, 2018March 25, 2019 Fabrice

From a list directly: {{ somelist|join(",") }} From a list of objects: {% for x in somelist %}{{ x.xyz }}{% if not loop.last %},{% endif %}{% endfor %} I work as a freelancer, so if you don’t want or don’t… Read More

AutomationAnsible, Jinja2Leave a comment

Recent Posts

  • How to persist variables in a loop from a find command in Bash?
  • How to iterate an array in Bash?
  • How to trim leading and trailing characters in Bash?
  • How to install jq on CentOS?
  • Magic SysRq cheatsheet

Categories

  • Automation
  • AWS
  • Bash
  • CentOS
  • Containers
  • Cryptography
  • Database
  • Development
  • Docker
  • Git
  • Linux
  • Python
  • Sysadmin
  • Virtualization

Archives

  • December 2020
  • October 2020
  • August 2020
  • July 2020
  • June 2020
  • April 2020
  • March 2020
  • February 2020
  • November 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
Copyright © 2018-2019 Fabrice Triboix
Best Business by Axle Themes