Fix lookup_passwordstore integration test for CentOS 8 (#64869)

pass is no longer packaged in EPEL
https://lists.zx2c4.com/pipermail/password-store/2019-July/003689.html
This commit is contained in:
Sam Doran 2019-11-15 17:37:43 -05:00 committed by GitHub
parent f2e605c856
commit 4291f09a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 52 additions and 53 deletions

View File

@ -1,6 +1,7 @@
- block: - block:
- include: "package.yml" - include_tasks: package.yml
- include: "tests.yml" - include_tasks: tests.yml
when: when:
- not (ansible_distribution == 'RedHat') # requires EPEL # The pass package is no longer available in EPEL, so only test on Fedora, OpenSUSE, FreeBSD, macOS, and Ubuntu
- not (ansible_distribution == 'CentOS' and ansible_distribution_version is version_compare('7', '<')) # https://lists.zx2c4.com/pipermail/password-store/2019-July/003689.html
- ansible_facts.distribution in ['FreeBSD', 'MacOSX', 'openSUSE Leap', 'Ubuntu']

View File

@ -1,29 +1,29 @@
- name: "Install package" - name: Include distribution specific variables
apt: include_vars: "{{ lookup('first_found', params) }}"
name: pass vars:
state: present params:
when: ansible_pkg_mgr == 'apt' files:
- "{{ ansible_facts.distribution }}.yml"
- "{{ ansible_facts.os_family }}.yml"
- default.yml
paths:
- "{{ role_path }}/vars"
- name: "Install package" - name: Install package
yum: action: "{{ ansible_facts.pkg_mgr }}"
name: pass args:
name: "{{ passwordstore_packages }}"
state: present state: present
when: ansible_pkg_mgr == 'yum' when: ansible_facts.pkg_mgr in ['apt', 'dnf', 'yum', 'pkgng']
- name: "Install package"
dnf:
name: pass
state: present
when: ansible_pkg_mgr == 'dnf'
- block: - block:
# OpenSUSE Leap>=15.0 don't include password-store in main repo # OpenSUSE Leap>=15.0 don't include password-store in main repo
- name: add security:privacy repo - name: SUSE | Add security:privacy repo
template: template:
src: security-privacy.repo.j2 src: security-privacy.repo.j2
dest: /etc/zypp/repos.d/security:privacy.repo dest: /etc/zypp/repos.d/security:privacy.repo
- name: "Install package" - name: SUSE | Install package
zypper: zypper:
name: password-store name: password-store
state: present state: present
@ -31,37 +31,28 @@
disable_gpg_check: yes disable_gpg_check: yes
when: ansible_pkg_mgr == 'zypper' when: ansible_pkg_mgr == 'zypper'
- name: "Install package" - name: Install on macOS
pkgng: when: ansible_facts.distribution == 'MacOSX'
name: "{{ item }}" block:
state: present - name: MACOS | Find brew binary
with_items: command: which brew
- "gnupg" register: brew_which
- "password-store"
when: ansible_pkg_mgr == 'pkgng'
- name: MACOS | Get owner of brew binary
stat:
path: "{{ brew_which.stdout }}"
register: brew_stat
- name: Find brew binary - name: MACOS | Install package
command: which brew homebrew:
register: brew_which name:
when: ansible_distribution in ['MacOSX'] - gnupg2
- name: Get owner of brew binary - pass
stat: state: present
path: "{{ brew_which.stdout }}" update_homebrew: no
register: brew_stat become: yes
when: ansible_distribution in ['MacOSX'] become_user: "{{ brew_stat.stat.pw_name }}"
- name: "Install package" # Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
homebrew: # proper solution can be found
name: "{{ item }}" environment:
state: present HOMEBREW_NO_AUTO_UPDATE: True
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

View File

@ -0,0 +1,2 @@
passwordstore_packages:
- pass

View File

@ -0,0 +1,2 @@
passwordstore_packages:
- pass

View File

@ -0,0 +1,3 @@
passwordstore_packages:
- gnupg
- password-store