# - name: Build aur packages
#   register: buildaur
#   become_user: "{{ build_user.name }}"
#   command: "aurutils-sync --no-view {{ item }}"
#   args:
#     creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
#   loop:
#     - foo

# - name: Update cache
#   when: buildaur.changed
#   pacman:
#     name: []
#     state: present
#     update_cache: true

- name: Install packages
  package:
    name:
      - ansible
    state: present

- name: Create directories
  file:
    name: "{{ item }}"
    state: directory
    mode: 0755
    owner: root
    group: wheel
  loop:
    - /usr/share/ansible/plugins/connection_plugins

- name: Install sshjail plugin
  ansible.builtin.get_url:
    url: https://raw.githubusercontent.com/austinhyde/ansible-sshjail/e712c537ecdfc7a660f222fbac4172dd715fc130/sshjail.py
    dest: /usr/share/ansible/plugins/connection_plugins/sshjail.py
    mode: "0555"
    checksum: sha512:730c887ae7bbf2de34da44fb10a45fdeff649e3f2447df821c93ef02a21ecbef7db2fd57f1fc85fcd0b5b86fa30aa2b9ef143865d1e5086620c7dbe0633207cd
