Correctly set user to become

This commit is contained in:
Jake Howard 2018-09-14 09:01:11 +01:00
parent cfa484b8cb
commit 3cfb80a324
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 19 additions and 8 deletions

View file

@ -1,5 +1,7 @@
- hosts: local
connection: local
become: true
become_user: root
tasks:
- ping:
- include_vars:

View file

@ -2,7 +2,8 @@
name: aur_builder
group: wheel
- lineinfile:
- name: sudoers file
lineinfile:
path: /etc/sudoers.d/11-install-aur_builder
line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
create: true
@ -12,20 +13,23 @@
aur:
skip_installed: true
name: yay
become: aur_builder
become: true
become_user: aur_builder
- name: "Upgrade system"
aur:
use: yay
upgrade: true
become: aur_builder
become: true
become_user: aur_builder
- name: "Install initial packages"
aur:
use: yay
skip_installed: true
name: "{{ item }}"
become: aur_builder
become: true
become_user: aur_builder
with_items:
- 'i3-gaps'
- 'ttf-google-fonts-git'
@ -36,7 +40,8 @@
use: yay
skip_installed: true
name: "{{ item }}"
become: aur_builder
become: true
become_user: aur_builder
with_items:
- 'acpi'
- 'advanced-ssh-config'

View file

@ -10,13 +10,17 @@
mode: 0644
owner: jake
- shell: "code --list-extensions"
- name: "Get VSCode extensions"
shell: "code --list-extensions"
become: true
become_user: jake
register: vscode_extensions
- name: "Install VSCode extensions"
shell: "code --install-extension {{ item }}"
become: jake
when: "item not in vscode_extensions"
become: true
become_user: jake
when: "item not in vscode_extensions.stdout_lines"
with_items:
- 'PKief.material-icon-theme'
- 'PeterJausovec.vscode-docker'