Skip to content

Instantly share code, notes, and snippets.

@XenGi
Last active March 18, 2018 16:56
Show Gist options
  • Save XenGi/2707c49b297bde9c787b888b9432ed33 to your computer and use it in GitHub Desktop.
Save XenGi/2707c49b297bde9c787b888b9432ed33 to your computer and use it in GitHub Desktop.
[defaults]
inventory = inventory.yml
deprecation_warnings = True
nocows = 0
private_key_file = files/id_ed25519_deploy
#vault_password_file = vault.sh
ansible_managed = This file is managed by Ansible, all changes will be lost.
[privilege_escalation]
become = True
become_method = sudo
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o IdentitiesOnly=yes -o PreferredAuthentications=publickey
tasks:
- name: install git
pacman:
name: git
state: installed
update_cache: yes
- name: add gpg keys
become: False
command: gpg --recv-keys 1EB2638FF56C0C53 1A9D657D06B5820E
changed_when: "command_result.stdout == 'gpg: imported:'"
- name: check for pacaur
command: which pacaur
register: pacaur_installed
ignore_errors: True
- name: clone repos for cower and pacaur
become: False
git:
repo: '{{ item.url }}'
dest: '{{ item.dir }}'
with_items:
- { url: 'https://aur.archlinux.org/cower.git', dir: '/tmp/cower' }
- { url: 'https://aur.archlinux.org/pacaur.git', dir: '/tmp/pacaur' }
when: pacaur_installed|failed
- name: install cower and pacaur
become: False
command: LC_ALL=C makepkg -csi --noconfirm chdir='{{ item }}'
with_items:
- '/tmp/cower'
- '/tmp/pacaur'
when: pacaur_installed|failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment