1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_dotfiles.git synced 2024-08-16 16:09:49 +02:00

split config to more subtasks

This commit is contained in:
L3D 2021-09-19 03:26:26 +02:00
parent b34fc14d8b
commit 140381b5a6
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 58 additions and 52 deletions

View file

@ -13,55 +13,8 @@
ansible.builtin.include_tasks: bashrc.yml
when: dotfiles__modify_bashrc | bool
- name: Copy vimrc configuration to root
become: true
ansible.builtin.copy:
src: 'templates/vimrc'
dest: '/root/.vimrc'
owner: root
group: root
mode: 'u=rw,g=r,o='
- name: deploy vimrc
ansible.builtin.include_tasks: vimrc.yml
- name: Copy vimrc configuration to non admin users
become: true
ansible.builtin.copy:
src: 'templates/vimrc'
dest: '/home/{{ item }}/.vimrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: "{{ accounts }}"
when:
- accounts is defined
- accounts != ['root']
- accounts != 'root'
- name: create .config/ranger/ directory
become: true
ansible.builtin.file:
path: "/home/{{ item }}/.config/ranger"
state: directory
owner: "{{ item }}"
group: "{{ item }}"
recurse: true
with_items: "{{ accounts }}"
when:
- dotfiles__ranger_hidden_files | bool
- accounts is defined
- accounts != ['root']
- accounts != 'root'
- name: create .config/ranger/rc.conf file
become: true
ansible.builtin.template:
src: templates/ranger_rc.conf.j2
dest: "/home/{{ item }}/.config/ranger/rc.conf"
owner: "{{ item }}"
group: "{{ item }}"
mode: '0644'
with_items: "{{ accounts }}"
when:
- dotfiles__ranger_hidden_files | bool
- accounts is defined
- accounts != ['root']
- accounts != 'root'
- name: deploy ranger config
ansible.builtin.include_tasks: ranger.yml

30
tasks/ranger.yml Normal file
View file

@ -0,0 +1,30 @@
---
- name: create .config/ranger/ directory
become: true
ansible.builtin.file:
path: "/home/{{ item }}/.config/ranger"
state: directory
owner: "{{ item }}"
group: "{{ item }}"
recurse: true
with_items: "{{ accounts }}"
when:
- dotfiles__ranger_hidden_files | bool
- accounts is defined
- accounts != ['root']
- accounts != 'root'
- name: create .config/ranger/rc.conf file
become: true
ansible.builtin.template:
src: templates/ranger_rc.conf.j2
dest: "/home/{{ item }}/.config/ranger/rc.conf"
owner: "{{ item }}"
group: "{{ item }}"
mode: '0644'
with_items: "{{ accounts }}"
when:
- dotfiles__ranger_hidden_files | bool
- accounts is defined
- accounts != ['root']
- accounts != 'root'

23
tasks/vimrc.yml Normal file
View file

@ -0,0 +1,23 @@
---
- name: Copy vimrc configuration to root
become: true
ansible.builtin.copy:
src: 'templates/vimrc'
dest: '/root/.vimrc'
owner: root
group: root
mode: 'u=rw,g=r,o='
- name: Copy vimrc configuration to non admin users
become: true
ansible.builtin.copy:
src: 'templates/vimrc'
dest: '/home/{{ item }}/.vimrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: "{{ accounts }}"
when:
- accounts is defined
- accounts != ['root']
- accounts != 'root'

View file

@ -1,3 +1,3 @@
---
playbook_version_number: 2072 # should be increased integer
playbook_version_number: 2073 # should be increased integer
playbook_version_path: 'role_dotfiles_chaos-bodensee_github.version'