Categories
Ukategorisert

Ansible Notes

Vim indentation config

autocmd FileType yaml setlocal ai ts=2 sw=2 et
facts associated with a managed host can be obtained using the command:
ansible system_hostname -i inventory_file -m setup

ansible-playbook command with the --ask-pass for:

- name: Public key is deployed to managed hosts for Ansible
  hosts: all

  tasks:
    - name: Ensure key is in root's ~/.ssh/authorized_hosts
      authorized_key:
        user: root
        state: present
        key: '{{ item }}'
      with_file:
        - ~/.ssh/id_rsa.pub