-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
118 lines (105 loc) · 2.34 KB
/
playbook.yml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
- name: Github Init Playbook
gather_facts: no
hosts: localhost
vars:
source_key: "ssh/id_rsa"
dest_key: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa"
tasks:
- name: 3] git user.email
git_config:
name: user.email
scope: global
value: "[email protected]"
tags:
- git
- github
- termux
- ubuntu
- macos
- name: 3] git user.name
git_config:
name: user.name
scope: global
value: "curelesss"
tags:
- git
- github
- termux
- ubuntu
- macos
- name: 3] Ensure .ssh directory exists
file:
dest: "{{ dest_key | dirname }}"
mode: 0700
state: directory
tags:
- ssh
- github
- termux
- ubuntu
- macos
- name: 3] Install ssh key
copy:
src: "{{ source_key }}"
dest: "{{ dest_key }}"
mode: 0600
tags:
- ssh
- github
- termux
- ubuntu
- macos
- name: 3] Install git config
ansible.builtin.command:
cmd: cp ssh/config "{{ lookup('env', 'HOME') }}/.ssh/"
tags:
- ssh
- github
- termux
- ubuntu
- macos
- name: 3] Install openssh
become: yes
pacman:
name: openssh
state: present
tags:
- ssh
- github
- name: 3] Install openssh - termux
command: pkg install openssh -y
tags:
- termux
- name: 4] Install GNU Stow
become: yes
pacman:
name: stow
state: present
- name: 4] check dotfile directory
stat:
path: "~/dotfiles"
register: dotfiles_dir
tags:
- dotfile
- termux
- name: 4] clone dotfiles
git:
repo: "[email protected]:curelesss/dotfiles.git"
dest: "~/dotfiles"
when: not dotfiles_dir.stat.exists
tags:
- dotfile
- termux
- name: 5] check .init.ubuntu directory
stat:
path: "~/.init.ubuntu"
register: init_ubuntu_dir
tags:
- .init.ubuntu
- name: 5] clone .init.ubuntu
git:
repo: "[email protected]:curelesss/.init.ubuntu.git"
dest: "~/.init.ubuntu"
when: not init_ubuntu_dir.stat.exists
tags:
- .init.ubuntu