-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.yml
More file actions
59 lines (53 loc) · 1.68 KB
/
Copy pathmain.yml
File metadata and controls
59 lines (53 loc) · 1.68 KB
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
---
- name: System update/upgrade
become: true
become_user: root
ansible.builtin.apt:
update_cache: true
upgrade: 'dist'
cache_valid_time: 84600
- name: Packages installation
become: true
become_user: root
ansible.builtin.apt:
name: "{{ apt_packages }}"
update_cache: true
autoremove: true
- name: Ensure ~/.vim/colors directory exists
ansible.builtin.file:
path: "{{ ansible_facts['env']['HOME'] }}/.vim/colors"
state: directory
owner: "{{ ansible_facts['env']['LOGNAME'] }}"
group: "{{ ansible_facts['env']['LOGNAME'] }}"
mode: '0755'
- name: Download Solarized colorscheme
ansible.builtin.get_url:
url: "{{ colorscheme_solarized_url }}"
dest: "{{ ansible_facts['env']['HOME'] }}/.vim/colors/solarized.vim"
owner: "{{ ansible_facts['env']['LOGNAME'] }}"
group: "{{ ansible_facts['env']['LOGNAME'] }}"
mode: '0644'
- name: Deploy .vimrc from template
ansible.builtin.template:
src: vimrc.j2
dest: "{{ ansible_facts['env']['HOME'] }}/.vimrc"
owner: "{{ ansible_facts['env']['LOGNAME'] }}"
group: "{{ ansible_facts['env']['LOGNAME'] }}"
mode: '0644'
- name: Add managed aliases block to .bashrc
ansible.builtin.blockinfile:
path: "{{ ansible_facts['env']['HOME'] }}/.bashrc"
block: |
{% for alias in bashrc_aliases %}
{{ alias }}
{% endfor %}
marker: "# {mark} ANSIBLE MANAGED BLOCK - aliases"
insertafter: EOF
create: true
- name: Ensure other custom lines exist in .bashrc
ansible.builtin.lineinfile:
path: "{{ ansible_facts['env']['HOME'] }}/.bashrc"
regexp: '^# Custom Ansible config'
line: "# Custom Ansible config"
insertafter: EOF
state: present