bootstrap.yml (1743B)
1 --- 2 - name: Bootstrap CachyOS workstation 3 hosts: cachy 4 connection: local 5 6 tasks: 7 - name: Install tailscale 8 community.general.pacman: 9 name: tailscale 10 state: present 11 become: true 12 13 - name: Enable and start tailscaled 14 ansible.builtin.service: 15 name: tailscaled 16 state: started 17 enabled: true 18 become: true 19 20 - name: Clone GPG keys repo 21 ansible.builtin.git: 22 repo: cjr@192.168.0.194:/home/cjr/git/keys 23 dest: "{{ ansible_facts['user_dir'] }}/.gpg-keys" 24 update: true 25 version: main 26 accept_hostkey: true 27 28 - name: Import GPG public key 29 ansible.builtin.command: 30 cmd: gpg --import {{ ansible_facts['user_dir'] }}/.gpg-keys/public-key.asc 31 register: gpg_import_public 32 changed_when: "'imported' in gpg_import_public.stderr" 33 34 - name: Import GPG secret key 35 ansible.builtin.command: 36 cmd: gpg --import {{ ansible_facts['user_dir'] }}/.gpg-keys/secret-key.asc 37 register: gpg_import_secret 38 changed_when: "'imported' in gpg_import_secret.stderr" 39 no_log: true 40 41 - name: Remove cloned GPG keys 42 ansible.builtin.file: 43 path: "{{ ansible_facts['user_dir'] }}/.gpg-keys" 44 state: absent 45 46 - name: Clone password store 47 ansible.builtin.git: 48 repo: cjr@192.168.0.194:/home/cjr/.password-store 49 dest: "{{ ansible_facts['user_dir'] }}/.password-store" 50 update: true 51 version: main 52 accept_hostkey: true 53 54 - name: Authenticate Tailscale 55 ansible.builtin.command: 56 cmd: tailscale up --auth-key={{ lookup('pipe', 'pass show tailscale/auth-key') }} 57 become: true 58 no_log: true 59 changed_when: true