-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path30-userspace.yaml
100 lines (80 loc) · 2.9 KB
/
30-userspace.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
- name: Install userspace files/progrems
hosts: arch
tasks:
- name: Install yay
block:
- name: Clone PKGBUILD
ansible.builtin.git:
repo: https://aur.archlinux.org/yay.git
dest: /tmp/yay
version: master
- name: Dirty repo sync without updating
ansible.builtin.command:
cmd: pacman -Sy
changed_when: true
become: true
- name: Run makepkg
ansible.builtin.command:
cmd: makepkg -si --noconfirm # Installs also
chdir: /tmp/yay
creates: /tmp/yay/yay*pkg*
when: not ansible_check_mode
- name: Register if default ssh key exists
ansible.builtin.stat:
path: .ssh/id_ed25519
register: ssh_key_stat
- name: Actions when default ssh keys does not exist
when: not ssh_key_stat.stat.exists
block:
- name: Create ssh key for user
ansible.builtin.command:
cmd: "ssh-keygen -t ed25519 -f .ssh/id_ed25519 -N {{ newsshkey_passphrase }}"
changed_when: not ssh_key_stat.stat.exists
- name: Slurp just generated public key
ansible.builtin.slurp:
src: .ssh/id_ed25519.pub
register: public_key_slurp_b64
when: not ansible_check_mode
- name: Decode slurp
ansible.builtin.set_fact:
public_key_slurp: "{{ public_key_slurp_b64['content'] | b64decode }}"
when: not ansible_check_mode
- name: Print just generated key
ansible.builtin.debug:
msg: "{{ public_key_slurp }}"
when: not ansible_check_mode
- name: Pause, manually install new ssh key to github
ansible.builtin.pause:
prompt: "https://github.com/settings/ssh/new"
when: not ansible_check_mode
- name: Copy .dotfiles
block:
- name: Copy auxiliary github ssh key
ansible.builtin.copy:
content: "{{ auxiliary_github_key }}"
dest: .ssh/github
mode: 0600
- name: Copy .dotfiles using auxilary ssh key
ansible.builtin.git:
repo: [email protected]:MrSauna/.dotfiles.git
dest: .dotfiles
version: master
key_file: ~/.ssh/github
accept_newhostkey: true
when: not ansible_check_mode
- name: Install pkglist.txt from .dotfiles
ansible.builtin.shell:
cmd: yay -Syu --needed --noconfirm --nocleanmenu --nodiffmenu - < ~/.dotfiles/pkglist.txt
changed_when: true
- name: Stow-all the first time
block:
- name: Register if stowed .zshrc
ansible.builtin.stat:
path: .zshrc
register: dot_zshrc
- name: Stow all when dot_zshrc doesn't exist
ansible.builtin.command:
cmd: ./stow-all.sh
chdir: .dotfiles
when: not dot_zshrc.stat.exists