diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-09-06 16:14:25 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-09-06 16:14:25 +0300 |
commit | 741cd824709a66d0d218d7590abd42422f7c7cdc (patch) | |
tree | 3378cc2d507addd9895c3b7d46107d13de5d4a5c /ansible/radicle-dev.yml | |
parent | 600139afaf1c99499c2c3cde0767dc8809c96272 (diff) | |
download | ansibleness-741cd824709a66d0d218d7590abd42422f7c7cdc.tar.gz |
radicle-dev: fix install of keys
Sponsored-by: author
Diffstat (limited to 'ansible/radicle-dev.yml')
-rw-r--r-- | ansible/radicle-dev.yml | 68 |
1 files changed, 62 insertions, 6 deletions
diff --git a/ansible/radicle-dev.yml b/ansible/radicle-dev.yml index faa0e81..005f5ef 100644 --- a/ansible/radicle-dev.yml +++ b/ansible/radicle-dev.yml @@ -10,20 +10,35 @@ - role: liw - role: emacs tasks: - - apt: + - name: "install important additional packages" + apt: name: - build-essential - debhelper - dh-cargo - python3 - ripgrep - - file: + + - name: "reload dbus" + systemd: + name: dbus + state: reloaded + + - name: "reload sshd" + systemd: + name: sshd + state: reloaded + + - name: "create liw systemd/user config directory" + file: state: directory path: /home/liw/.config/systemd/user/ owner: liw group: liw mode: 0755 - - copy: + + - name: "install systemd unit for ssh-agent without graphical desktop" + copy: content: | [Unit] Description=SSH key agent @@ -39,15 +54,53 @@ owner: liw group: liw mode: 0644 - - copy: + + - name: "create environment.d for liw" + file: + state: directory + path: /home/liw/.config/environment.d + owner: liw + group: liw + mode: 0755 + + - name: "create environment variable file for liw" + copy: content: | SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket" dest: /home/liw/.config/environment.d/ssh_auth_socket.conf owner: liw group: liw mode: 0644 - - shell: | - sudo -u liw sh <(curl -sSf https://radicle.xyz/install) + + - name: "install radicle using installer" + shell: | + if [ ! -e /home/liw/.radicle/bin/rad ]; then + curl -sSf https://radicle.xyz/install | sudo -u liw bash + fi + + - name: "create liw/.radicle/keys" + file: + state: directory + path: /home/liw/.radicle/keys + owner: liw + group: liw + mode: 0755 + + - name: "install radicle private key" + copy: + content: "{{ radicle_key }}" + dest: /home/liw/.radicle/keys/radicle + owner: liw + group: liw + mode: 0600 + + - name: "install radicle public key" + copy: + content: "{{ radicle_pub }}" + dest: /home/liw/.radicle/keys/radicle.pub + owner: liw + group: liw + mode: 0644 vars: ansible_python_interpreter: /usr/bin/python3 @@ -75,3 +128,6 @@ rustup_cargo_install: | starship \ ytop + + radicle_key: "{{ lookup('pipe', 'pass radicle/key') }}" + radicle_pub: "{{ lookup('pipe', 'pass radicle/key.pub') }}" |