Skip to content

Commit

Permalink
fix: refactor playbooks by merging prepare tasks into converge
Browse files Browse the repository at this point in the history
  • Loading branch information
krudi committed May 19, 2024
1 parent 5b418e7 commit 28db8d5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
23 changes: 23 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@
- name: Converge
hosts: all

pre_tasks:
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 600

- name: Ensure required packages are installed
ansible.builtin.package:
name: "{{ dependency }}"
state: present
loop: "{{ nvm_dependencies }}"
loop_control:
loop_var: dependency

- name: Create users for testing
ansible.builtin.user:
name: "{{ user.username }}"
shell: /bin/bash
state: present
with_items: "{{ users }}"
loop_control:
loop_var: user

roles:
- role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
nvm_dependencies:
Expand Down
1 change: 0 additions & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ provisioner:
name: ansible
playbooks:
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
prepare: prepare.yml

verifier:
name: ansible
Expand Down
22 changes: 0 additions & 22 deletions molecule/default/prepare.yml

This file was deleted.

0 comments on commit 28db8d5

Please sign in to comment.