1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_dotfiles.git synced 2024-08-16 16:09:49 +02:00
ansible_role_dotfiles/tasks/main.yml
2019-03-06 11:31:51 +01:00

88 lines
2 KiB
YAML

---
- name: install the latest libselinux-python package
become: yes
dnf:
name: libselinux-python
state: latest
when: ansible_distribution == "Fedora"
- name: install keychain to support ssh agent
become: yes
package:
name: keychain
state: latest
when:
- ansible_os_family != 'RedHat'
- name: install keychain on centos
become: yes
yum:
name:
- https://centos.pkgs.org/7/psychotic-ninja-x86_64/keychain-2.7.1-1.el7.psychotic.noarch.rpm.html
- libselinux-python
state: present
when: ansible_os_family == 'RedHat'
- name: Create a global bashrc configuration
become: yes
template:
src: 'templates/bash.bashrc'
dest: '/etc/bash.bashrc'
owner: root
group: root
mode: 'u=rw,g=r,o=r'
- name: Copy bashrc configuration to admin users
become: yes
template:
src: 'templates/bashrc'
dest: '/home/{{ item }}/.bashrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: '{{ admins }}'
when: admins is defined
- name: Copy bashrc configuration to non admin users
become: yes
template:
src: 'templates/bashrc'
dest: '/home/{{ item }}/.bashrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: '{{ user }}'
when: user is defined
- name: Copy vimrc configuration to root
become: yes
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: yes
copy:
src: 'templates/vimrc'
dest: '/home/{{ item }}/.vimrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: "{{ user }}"
when: user is defined
- name: Copy vimrc configuration to admin users
become: yes
copy:
src: 'templates/vimrc'
dest: '/home/{{ item }}/.vimrc'
owner: '{{ item }}'
group: '{{ item }}'
mode: 'u=rw,g=r,o='
with_items: "{{ admins }}"
when: admins is defined