Update to more recent Ansible roles
This commit is contained in:
@@ -10,4 +10,9 @@
|
||||
|
||||
- name: Set skeleton files for new users
|
||||
template: src=files/.bash_aliases dest=/etc/skel/.bash_aliases
|
||||
|
||||
|
||||
- name: Configure unattended upgrades
|
||||
template:
|
||||
src: files/50unattended-upgrades
|
||||
dest: /etc/apt/apt.conf.d/50unattended-upgrades
|
||||
|
||||
|
||||
14
ansible/roles/core/tasks/configure-ranger.yml
Normal file
14
ansible/roles/core/tasks/configure-ranger.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Configure ranger
|
||||
copy:
|
||||
src: files/ranger
|
||||
dest: "{{ item }}"
|
||||
with_items:
|
||||
- /home/ansibleuser/.config
|
||||
- /etc/skel/.config
|
||||
|
||||
- name: Set ranger permissions
|
||||
file:
|
||||
dest: /home/ansibleuser/.config/ranger/
|
||||
group: ansibleuser
|
||||
owner: ansibleuser
|
||||
@@ -11,17 +11,22 @@
|
||||
template: src=files/sshd dest=/etc/pam.d/sshd
|
||||
|
||||
- name: Add authusers file
|
||||
copy:
|
||||
dest: "/etc/authusers"
|
||||
content: |
|
||||
user1
|
||||
user2
|
||||
lineinfile:
|
||||
dest: /etc/authusers
|
||||
line: '{{ item }}'
|
||||
with_items:
|
||||
- 'user1'
|
||||
- 'user2'
|
||||
|
||||
- name: Add authorized_yubikeys file
|
||||
copy:
|
||||
dest: "/etc/ssh/authorized_yubikeys"
|
||||
content: |
|
||||
user:cccckey1cccc:cccckey2cccc
|
||||
src: files/authorized_yubikeys
|
||||
dest: /etc/ssh/
|
||||
|
||||
- name: Copy adduser.sh script
|
||||
copy:
|
||||
src: files/adduser.sh
|
||||
dest: /home/ansibleuser/
|
||||
|
||||
- name: Add custom /etc/hosts
|
||||
lineinfile:
|
||||
@@ -29,15 +34,15 @@
|
||||
line: '{{ item }}'
|
||||
with_items:
|
||||
- '127.0.0.1 localhost'
|
||||
- '127.0.0.2 www.otherhost.com otherhost'
|
||||
- '123.123.123.12 some.domain.com somewhere'
|
||||
- '12.12.12.12 other.domains.com somewhereelse'
|
||||
|
||||
- name: Add SSH Keys
|
||||
lineinfile:
|
||||
dest: /home/ansible/.ssh/authorized_keys
|
||||
dest: /home/ansibleuser/.ssh/authorized_keys
|
||||
line: '{{ item }}'
|
||||
with_items:
|
||||
- 'ssh-idrsa AAZ1NTE5AAAAIA+ndydG+ddddpdddaabvbumkiuyk7778678676547564563434XwmnYb user@host'
|
||||
|
||||
- 'ssh-rsa 1232346A+7654475n4x5y6GL657+V6mJ5Yp23s6I6o4+6N ansibleuser@host'
|
||||
|
||||
- name: Copy ssh configuration file
|
||||
template: src=files/sshd_config dest=/etc/ssh/sshd_config
|
||||
|
||||
@@ -1,10 +1,60 @@
|
||||
---
|
||||
- name: Clone github.com/shaunrd0/klips
|
||||
- name: Create vim directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- /home/ansibleuser/.vim/
|
||||
- /home/ansibleuser/.vim/colors/
|
||||
- /home/ansibleuser/.vim/plugin/
|
||||
- /home/ansibleuser/.vim/doc/
|
||||
- /home/ansibleuser/.vim/bundle/
|
||||
- /home/ansibleuser/.vim/autoload/
|
||||
- /etc/skel/.vim/
|
||||
- /etc/skel/.vim/colors/
|
||||
- /etc/skel/.vim/plugin/
|
||||
- /etc/skel/.vim/doc/
|
||||
- /etc/skel/.vim/bundle/
|
||||
- /etc/skel/.vim/autoload/
|
||||
|
||||
- name: Install Pathogen, sourcerer theme
|
||||
copy:
|
||||
src: files/{{ item.src }}
|
||||
dest: /home/ansibleuser/.vim/{{ item.dest }}
|
||||
with_items:
|
||||
- { src: 'pathogen.vim', dest: 'autoload/pathogen.vim'}
|
||||
- { src: 'sourcerer.vim', dest: 'colors/sourcerer.vim'}
|
||||
|
||||
- name: Install sourcerer theme
|
||||
copy:
|
||||
src: files/pathogen.vim
|
||||
dest: /home/ansibleuser/.vim/autoload/
|
||||
|
||||
- name : Install vim plugins
|
||||
git:
|
||||
repo: https://github.com/shaunrd0/klips.git
|
||||
clone: yes
|
||||
dest: /etc/klips/
|
||||
repo: https://github.com/{{ item.repo }}
|
||||
dest: /home/ansibleuser/.vim/bundle/{{ item.dest }}
|
||||
with_items: "{{ vim_plugins }}"
|
||||
|
||||
- name: Run Vim setup script
|
||||
script: /etc/ansible/roles/core/files/setup-vim.sh
|
||||
- name: Install Pathogen, sourcerer theme within skeleton files
|
||||
copy:
|
||||
src: files/{{ item.src }}
|
||||
dest: /etc/skel/.vim/{{ item.dest }}
|
||||
with_items:
|
||||
- { src: 'pathogen.vim', dest: 'autoload/pathogen.vim'}
|
||||
- { src: 'sourcerer.vim', dest: 'colors/sourcerer.vim'}
|
||||
|
||||
- name: Install vim plugins within skeleton files
|
||||
git:
|
||||
repo: https://github.com/{{ item.repo }}
|
||||
dest: /etc/skel/.vim/bundle/{{ item.dest }}
|
||||
with_items: "{{ vim_plugins }}"
|
||||
|
||||
- name: Configure vim
|
||||
template:
|
||||
src: files/.vimrc
|
||||
dest: "{{ item }}"
|
||||
with_items:
|
||||
- /home/ansibleuser/.vimrc
|
||||
- /etc/skel/.vimrc
|
||||
|
||||
|
||||
@@ -1,4 +1,18 @@
|
||||
---
|
||||
- name: Install packages
|
||||
apt: name="{{ item }}" state=latest
|
||||
package: name="{{ item }}" state=present
|
||||
with_items: "{{ packages }}"
|
||||
- name: Ensure package lists are up-to-date
|
||||
apt:
|
||||
update_cache: yes
|
||||
- name: Ensure packages are up-to-date
|
||||
apt:
|
||||
upgrade: dist
|
||||
- name: Remove unused packages from the cache
|
||||
apt:
|
||||
autoclean: yes
|
||||
- name: Remove dependencies that are no longer required
|
||||
apt:
|
||||
autoremove: yes
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
- import_tasks: configure-git.yml
|
||||
|
||||
# Vim
|
||||
#- import_tasks: configure-vim.yml
|
||||
- import_tasks: configure-vim.yml
|
||||
- import_tasks: configure-ranger.yml
|
||||
|
||||
# Bash
|
||||
- import_tasks: configure-bash.yml
|
||||
|
||||
Reference in New Issue
Block a user