openpunk-ansible/tasks/git.yml

36 lines
972 B
YAML
Raw Normal View History

2022-05-31 04:36:55 +00:00
---
- name: Setup git config
copy:
2022-08-02 18:38:55 +00:00
src: static/.gitconfig
2022-05-31 04:36:55 +00:00
dest: /root/.gitconfig
owner: root
mode: u=rw,g=,o=
2022-08-02 18:49:02 +00:00
# make sure our vps trusts the github.com key signature. we pipe the output
# of ssh-keyscan into .ssh/known_hosts
2022-05-31 05:13:46 +00:00
- name: Scan for SSH host keys
command: ssh-keyscan github.com 2>/dev/null
2022-05-31 04:36:55 +00:00
register: ssh_scan
2022-05-31 05:13:46 +00:00
- name: Update known_hosts
copy:
content: "{{ ssh_scan.stdout_lines|join('\n') }}"
dest: /root/.ssh/known_hosts
owner: root
mode: u=rw,g=,o=
force: no # if we already have a known_hosts file, ignore!
2022-05-31 04:36:55 +00:00
2022-08-02 18:49:02 +00:00
# this keypair is trusted under my github account, so it allows my vps to make pushes
# to the main branch of my openpunk repository. (for my deadswitch: see static/blog/imdead.sh)
2022-05-31 05:13:46 +00:00
- name: Install ssh priv key
copy:
2022-05-31 04:36:55 +00:00
src: secrets/id_ed25519
2022-05-31 04:39:32 +00:00
dest: /root/.ssh/id_ed25519
2022-05-31 05:13:46 +00:00
mode: u=rw,g=,o=
2022-05-31 04:39:32 +00:00
2022-05-31 05:13:46 +00:00
- name: Install ssh pub key
copy:
2022-05-31 04:39:32 +00:00
src: secrets/id_ed25519.pub
dest: /root/.ssh/id_ed25519.pub