Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temporary passwordless sudo #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
with_fileglob:
- "{{ playbook_dir }}/config.yml"
tags: ['always']
- name: Add temporary passwordless sudo permissions
ansible.builtin.copy:
content: "{{ ansible_user }} ALL=(ALL) NOPASSWD: ALL"
dest: "/private/etc/sudoers.d/99_tmp_ansible"
validate: /usr/sbin/visudo -csf %s
mode: 0644
become: true

roles:
- role: elliotweiser.osx-command-line-tools
Expand Down Expand Up @@ -52,3 +59,9 @@
loop_var: outer_item
with_fileglob: "{{ post_provision_tasks|default(omit) }}"
tags: ['post']

- name: Remove temporary passwordless sudo permissions
ansible.builtin.file:
path: "/private/etc/sudoers.d/99_tmp_ansible"
state: absent
become: true
1 change: 1 addition & 0 deletions tasks/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
- name: Run .osx dotfiles.
command: "{{ osx_script }}"
changed_when: false
become: false