ansible/test/integration/targets/lookup_passwordstore/tasks/package.yml

68 lines
1.5 KiB
YAML
Raw Normal View History

- name: "Install package"
apt:
name: pass
state: present
when: ansible_pkg_mgr == 'apt'
- name: "Install package"
yum:
name: pass
state: present
when: ansible_pkg_mgr == 'yum'
- name: "Install package"
dnf:
name: pass
state: present
when: ansible_pkg_mgr == 'dnf'
- block:
# OpenSUSE Leap>=15.0 don't include password-store in main repo
- name: add security:privacy repo
template:
src: security-privacy.repo.j2
dest: /etc/zypp/repos.d/security:privacy.repo
- name: "Install package"
zypper:
name: password-store
state: present
update_cache: yes
disable_gpg_check: yes
when: ansible_pkg_mgr == 'zypper'
- name: "Install package"
pkgng:
name: "{{ item }}"
state: present
with_items:
- "gnupg"
- "password-store"
when: ansible_pkg_mgr == 'pkgng'
- name: Find brew binary
command: which brew
register: brew_which
when: ansible_distribution in ['MacOSX']
- name: Get owner of brew binary
stat:
path: "{{ brew_which.stdout }}"
register: brew_stat
when: ansible_distribution in ['MacOSX']
- name: "Install package"
homebrew:
name: "{{ item }}"
state: present
update_homebrew: no
with_items:
- "gnupg2"
- "pass"
become: yes
become_user: "{{ brew_stat.stat.pw_name }}"
when: ansible_pkg_mgr == 'homebrew'
# Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
# proper solution can be found
environment:
HOMEBREW_NO_AUTO_UPDATE: True