-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-dotfiles.yml
54 lines (44 loc) · 1.42 KB
/
deploy-dotfiles.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
---
- hosts: all
strategy: linear
tasks:
- name: Debug
debug: msg={{ ansible_os_family }}
- set_fact: package_name=httpd
when: ansible_os_family == "RedHat"
- set_fact: package_name=apache2
when: ansible_os_family == "Debian"
- set_fact: package_name=tar
when: ansible_os_family == "RedHat"
- set_fact: package_name=tar
when: ansible_os_family == "Debian"
# - name: Install dnf on centos7 for better compatibility.
# yum: name=dnf state=latest
# when: ansible_os_family == "RedHat"
- name: Install zsh for Fedora/CentOS
yum: name=zsh state=latest
when: ansible_os_family == "RedHat"
- name: Install zsh for Debian/Ubuntu
apt: name=zsh state=latest
when: ansible_os_family == "Debian"
- name: Install tar for Fedora/CentOS
yum: name=tar state=latest
when: ansible_os_family == "RedHat"
- name: Install tar for Debian/Ubuntu
apt: name=tar state=latest
when: ansible_os_family == "Debian"
- name: Deploy dotfiles to server/s.
copy:
src: rosen-dotfiles.tar
dest: /home/ralexandrov
owner: ralexandrov
group: ralexandrov
mode: "0644"
- name: Extract dotfiles.
unarchive:
src: /home/ralexandrov/rosen-dotfiles.tar
dest: /home/ralexandrov
remote_src: yes
owner: ralexandrov
group: ralexandrov
mode: "0755"