Ansible cheatsheet

Install

apt install python-dev python3-dev
pip install --user wheel ansible
# install RC, eg:
pip install --user wheel ansible==v2.9.0rc1

The inventory skeleton

all:
  hosts:
    my-host:
      ansible_connection: ssh
      ansible_ssh_host: 192.168.0.100
      ansible_ssh_port: 22
      ansible_ssh_user: foo
      ansible_ssh_pass: bar

How to load dconf for root user?

Some research done:

My (working) solution:

---
- name: Load dconf settings
  command: dconf load /
  args:
    stdin: "{{ dconf_contents }}"

- name: Load dconf settings for root
  command: dbus-launch dconf load /
  args:
    stdin: "{{ dconf_contents }}"
  become: true
  become_flags: -H

Settings are loaded from file.

« Vue.js tips and tricks - CheckSum »