Newer
Older
roles: [adarnimrod.openbsd-bootstrap]
roles: [adarnimrod.debian-bootstrap]
- name: Create SSH keypair
become: False
local_action: command ssh-keygen -t rsa -N '' -f files/id_rsa
run_once: True
args:
creates: files/id_rsa
- hosts: all
strategy: free
- role: adarnimrod.nginx
- role: pelican-gitreceive
pelican_gitreceive_public_keys: ['{{ lookup("file", "id_rsa.pub") }}']
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
post_tasks:
- name: Install curl
package:
name: curl
state: present
- name: Create .ssh directory
file:
path: /root/.ssh
owner: root
group: 0
mode: 0o0700
state: directory
- name: Copy private SSH key
copy:
src: id_rsa
dest: /root/.ssh/blog_rsa
owner: root
group: 0
mode: 0o0400
- name: Add SSH config
blockinfile:
dest: /root/.ssh/config
state: present
create: yes
block: |
Host localhost
HostName localhost
User git
IdentityFile /root/.ssh/blog_rsa
- name: Clone test blog
git:
dest: /root/blog
repo: https://www.shore.co.il/git/blog
version: master
recursive: yes
- name: Add localhost host keys to known hosts
shell: ssh-keyscan localhost > /root/.ssh/known_hosts
args:
creates: /root/.ssh/known_hosts
- name: Add localhost as a git remote
blockinfile:
dest: /root/blog/.git/config
block: |
[remote "test"]
url = git@localhost:test
fetch = +refs/heads/*:refs/remotes/test/*