Set the owner of Git repos on Windows
The `win_git` module clones repos as the current user, which since its an admin login is the admin. This patch adjusts the `win_owner` to so that repos are owned by the correct user when being used in a non-admin capacity.
This commit is contained in:
parent
9693194f7f
commit
06b511d823
@ -97,7 +97,11 @@
|
|||||||
elements: '{{cli_dir}}'
|
elements: '{{cli_dir}}'
|
||||||
|
|
||||||
- name: get op powershell completion script
|
- name: get op powershell completion script
|
||||||
win_command: op completion powershell
|
win_command:
|
||||||
|
argv:
|
||||||
|
- '{{ansible_env.LOCALAPPDATA}}/1Password/cli/op.exe'
|
||||||
|
- completion
|
||||||
|
- powershell
|
||||||
register: powershell_completion_script
|
register: powershell_completion_script
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
repo: git@code.infektor.net:config/AutoHotKey.git
|
repo: git@code.infektor.net:config/AutoHotKey.git
|
||||||
dest: '{{autohotkey_repo_dir}}'
|
dest: '{{autohotkey_repo_dir}}'
|
||||||
branch: master
|
branch: master
|
||||||
|
- win_owner:
|
||||||
|
path: '{{autohotkey_repo_dir}}'
|
||||||
|
user: Benie
|
||||||
|
|
||||||
- name: create scheduled task
|
- name: create scheduled task
|
||||||
win_scheduled_task:
|
win_scheduled_task:
|
||||||
|
@ -37,7 +37,10 @@
|
|||||||
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||||
version: master
|
version: master
|
||||||
with_items: '{{git_config_repos}}'
|
with_items: '{{git_config_repos}}'
|
||||||
timeout: 30
|
- win_owner:
|
||||||
|
path: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||||
|
user: Benie
|
||||||
|
with_items: '{{git_config_repos}}'
|
||||||
|
|
||||||
# - TODO: install pip packages
|
# - TODO: install pip packages
|
||||||
# win_pip:
|
# win_pip:
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
nvim_config_dir: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
||||||
|
|
||||||
- name: install chocolatey packages
|
- name: install chocolatey packages
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: neovim
|
name: neovim
|
||||||
@ -7,8 +10,11 @@
|
|||||||
- name: clone config repo
|
- name: clone config repo
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@code.infektor.net:config/vim.git
|
repo: git@code.infektor.net:config/vim.git
|
||||||
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
dest: '{{nvim_config_dir}}'
|
||||||
version: master
|
version: master
|
||||||
|
- win_owner:
|
||||||
|
path: '{{nvim_config_dir}}'
|
||||||
|
user: Benie
|
||||||
|
|
||||||
# - TODO: neovim set repo email
|
# - TODO: neovim set repo email
|
||||||
# win_git_config:
|
# win_git_config:
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
obsidian_notes_repo: '{{ansible_env.USERPROFILE}}/Documents/Notes'
|
||||||
|
|
||||||
- name: install chocolatey package
|
- name: install chocolatey package
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: obsidian
|
name: obsidian
|
||||||
@ -7,5 +10,8 @@
|
|||||||
- name: clone notes repository
|
- name: clone notes repository
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@github.com:kbenzie/notes.git
|
repo: git@github.com:kbenzie/notes.git
|
||||||
dest: '{{ansible_env.USERPROFILE}}/Documents/Notes'
|
dest: '{{obsidian_notes_repo}}'
|
||||||
branch: main
|
branch: main
|
||||||
|
- win_owner:
|
||||||
|
path: '{{obsidian_notes_repo}}'
|
||||||
|
user: Benie
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
powershell_config_dir:
|
||||||
|
'{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
|
||||||
|
|
||||||
- name: clone config repos
|
- name: clone config repos
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@code.infektor.net:config/WindowsPowerShell.git
|
repo: git@code.infektor.net:config/WindowsPowerShell.git
|
||||||
dest: '{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
|
dest: '{{powershell_config_dir}}'
|
||||||
branch: master
|
branch: master
|
||||||
|
- win_owner:
|
||||||
|
path: '{{powershell_config_dir}}'
|
||||||
|
user: Benie
|
||||||
|
|
||||||
- name: install chocolatey package
|
- name: install chocolatey package
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
@ -28,3 +35,9 @@
|
|||||||
name: PsReadline
|
name: PsReadline
|
||||||
state: latest
|
state: latest
|
||||||
accept_license: true
|
accept_license: true
|
||||||
|
|
||||||
|
- name: install posh-git module
|
||||||
|
win_psmodule:
|
||||||
|
name: posh-git
|
||||||
|
state: latest
|
||||||
|
accept_license: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user