Commit 63bdae16 authored by nimrod's avatar nimrod
Browse files

- Don't provision sudo, use the users role instead.

parent d9aeb154
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -36,21 +36,3 @@
    regexp: '^installpath ='
    state: present
    create: yes

- name: pkg install sudo
  when: ansible_distribution_release|version_compare('5.7', '>') and openbsd_bootstrap_sudo_group is defined
  ignore_errors: "{{ ansible_check_mode }}"
  openbsd_pkg:
      name: '{{ openbsd_bootstrap_sudo_pkg[ansible_distribution_release] }}'
      state: present

- name: Allow sudo access
  when: ansible_distribution_release|version_compare('5.7', '>') and openbsd_bootstrap_sudo_group is defined
  ignore_errors: "{{ ansible_check_mode }}"
  lineinfile:
      dest: '/etc/sudoers'
      line: '%{{ openbsd_bootstrap_sudo_group }} ALL=(ALL) NOPASSWD: ALL'
      regexp: '^%{{ openbsd_bootstrap_sudo_group }}'
      state: present
      owner: root
      group: wheel
+0 −5
Original line number Diff line number Diff line
@@ -5,8 +5,3 @@ testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all')

def test_example(Command):
    assert Command('uname').rc == 0


def test_root(Command, Sudo):
    with Sudo():
        assert Command('whoami').stdout.strip() == 'root'