Add the ability to install sudoers file
Change-Id: Ie4edfa60ca0defd9074f84f7ce6bf71b93d95959
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml
index 8a12536..d20d847 100644
--- a/molecule/default/converge.yml
+++ b/molecule/default/converge.yml
@@ -24,6 +24,8 @@
sha512crypt: >-
$6$rounds=656000$w0/M3W/p4fHA./tW$rHUMUTjI7UK68reJzWorpAidPLSuFoPkLqyWkwWiuhIg7Hkxw10AKMZuvFKzth5Uuotya8DzJZj6TiXy7U3wg1
sudoer: true
+ users_sudoers:
+ - "%users ALL=(ghopper) NOPASSWD: ALL"
tasks:
- name: "Include users"
include_role:
diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml
index 3525b8d..58ed917 100644
--- a/molecule/default/verify.yml
+++ b/molecule/default/verify.yml
@@ -7,6 +7,15 @@
- name: Verify
hosts: all
tasks:
- - name: example assertion
- assert:
- that: true
+
+ # testing that sudo works, so warning about "consider using become" is not
+ # applicable
+ - name: Make sure that sudoers is functional
+ become: true
+ become_user: "aturing"
+ command:
+ cmd: "sudo -u ghopper whoami"
+ register: sudo_out
+ failed_when: "'ghopper' not in sudo_out.stdout"
+ tags:
+ - skip_ansible_lint