Skip to content

Commit

Permalink
Molecule prepare updated, using become on tasks needed on role.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermodotn committed May 18, 2024
1 parent be78625 commit 9be90e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
---
- name: Prepare playbook
hosts: all
become: false
gather_facts: false

tasks:
- name: Install goodies (python3 & pip & gpg) for Debian OS-Family distros
ansible.builtin.raw: grep -q "debian" /etc/*-release && apt update && apt install -y python3 python3-pip gpg
- name: Install goodies (python3 & pip) for Debian OS-Family distros
ansible.builtin.raw: grep -q "debian" /etc/*-release && apt-get update && apt-get install -y python3 python3-pip
args:
executable: /bin/bash
ignore_errors: true
register: result
failed_when:
- result.rc != 0
- result.stderr != ""
changed_when: result.rc == 0

- name: Install sudo & gpg
ansible.builtin.package:
name:
- sudo
- gpg
state: present
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- name: RedHat OS family installation
when: ansible_os_family == 'RedHat'
#become: true
become: true
block:

- name: Import VSCodium gpg key to rpm db
Expand All @@ -29,7 +29,7 @@

- name: Debian OS family installation
when: ansible_os_family == 'Debian'
#become: true
become: true
block:

- name: Import VSCodium gpg key to keyring
Expand Down

0 comments on commit 9be90e6

Please sign in to comment.