Testing ansible playbook in molecule with "become"

111 views
Skip to first unread message

Hikaru Kenta

unread,
Jan 31, 2021, 3:33:18 AM1/31/21
to molecule-users
Hello, i wrote a playbook(s) to provision my local system.
https://github.com/kentahikaru/ansible-playbook-provision-ArchLinux
The idea is, to get my system into more less current state, after reinstall.
I'm trying to write a molecule testing (and later testing in github actions).
However,

First of all, my playbooks are connecting to localhost:
- hosts: localhost
connection: local
How will that work in molecule? Will hosts and connection be rewritten from converge.yml ?

Second, how can i pass "become password" from molecule to playbook ?
In my playbook i need "become" in several places, to install packages or setup something.
However molecule is failing on "sudo: a password is required\n"

Thanks for any help.
Reply all
Reply to author
Forward
0 new messages