-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook.yml
94 lines (78 loc) · 3.05 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
---
- hosts: 127.0.0.1
connection: local
gather_facts: true
tasks:
- name: upgrade all packages
ansible.builtin.package:
name: "*"
state: latest
when: ansible_facts['distribution'] != 'MacOSX'
- name: Configure Fedora OS
ansible.builtin.include_tasks: playbooks/fedora.yml
when: ansible_facts['distribution'] == 'Fedora'
- name: Configure Debian OS
ansible.builtin.include_tasks: playbooks/debian.yml
when: ansible_facts['distribution'] == 'Debian'
- name: Configure MacOS
ansible.builtin.include_tasks: playbooks/macos.yml
when: ansible_facts['distribution'] == 'MacOSX'
# TODO: make it work for Fedora
# - name: Install Oh-my-zsh
# block:
# - name: Download installer
# ansible.builtin.get_url:
# url: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
# dest: /tmp/ohmyzsh-install.sh
# mode: '0755'
# - name: Remove Oh My Zsh directory to make installer work
# ansible.builtin.file:
# name: "~/.oh-my-zsh"
# state: absent
# - name: Installation
# ansible.builtin.command: /tmp/ohmyzsh-install.sh
- name: Configure Environment
block:
- name: Configure zsh
ansible.builtin.copy:
src: "files/{{ ansible_facts['distribution'] }}.zshrc"
dest: '~/.zshrc'
- name: Configure zsh
block:
- name: Create zsh completions dir
ansible.builtin.file:
name: '~/.oh-my-zsh/completions'
state: directory
mode: '0755'
- name: Download kns completions
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/ahmetb/kubectx/master/completion/_kubens.zsh
dest: '~/.oh-my-zsh/completions/_kubens.zsh'
mode: '0755'
- name: Download ktx completions
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/ahmetb/kubectx/master/completion/_kubectx.zsh
dest: '~/.oh-my-zsh/completions/_kubectx.zsh'
mode: '0755'
- name: Configure Bash
ansible.builtin.copy:
src: "files/{{ ansible_facts['distribution'] }}.bashrc"
dest: '~/.bashrc'
- name: Setup Terraform env
ansible.builtin.file:
name: '~/.terraform.d/plugin-cache'
state: directory
- name: Configure Vim
block:
- name: Install vim-airline plugin
ansible.builtin.git:
repo: https://github.com/vim-airline/vim-airline
dest: '~/.vim/pack/dist/start/vim-airline'
- name: Configure Vim
ansible.builtin.copy:
src: "files/.vimrc"
dest: '~/.vimrc'
- name: Install kubectl aliases
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/ahmetb/kubectl-aliases/master/.kubectl_aliases
dest: '~/.kubectl_aliases'