begin using galaxy
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
- gnupg
|
||||
- lsb-release
|
||||
state: latest
|
||||
update_cache: yes
|
||||
update_cache: true
|
||||
|
||||
- name: Add Docker GPG Key
|
||||
become: true
|
||||
@@ -19,13 +19,13 @@
|
||||
- name: Add Docker Repository
|
||||
become: true
|
||||
apt_repository:
|
||||
repo: "deb [arch={{ arch }}] https://download.docker.com/linux/{{ansible_distribution|lower}} {{ansible_distribution_release}} stable"
|
||||
repo: "deb [arch={{ arch }}] https://download.docker.com/linux/{{ansible_distribution|lower}} {{ansible_distribution_release}} {{release_branch_docker}}"
|
||||
state: present
|
||||
|
||||
- name: Install Docker packages
|
||||
become: true
|
||||
apt:
|
||||
update_cache: yes
|
||||
update_cache: true
|
||||
pkg:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
@@ -39,7 +39,7 @@
|
||||
name: "{{ ansible_user_id }}"
|
||||
groups:
|
||||
- docker
|
||||
append: yes
|
||||
append: true
|
||||
|
||||
- name: Create docker folder in home directory
|
||||
file:
|
||||
|
||||
3
roles/install_dotfiles/defaults/main.yml
Normal file
3
roles/install_dotfiles/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
dotfiles_repo_source: "git@github.com:eneller/.dotfiles"
|
||||
dotfiles_repo_commit: "headless"
|
||||
dotfiles_repo_destination: ".dotfiles"
|
||||
29
roles/install_dotfiles/tasks/main.yml
Normal file
29
roles/install_dotfiles/tasks/main.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
- name: Check for existing dotfiles repository
|
||||
ansible.builtin.stat:
|
||||
path: "{{ dotfiles_repo_destination }}HEAD"
|
||||
register: dotfiles_repo_head
|
||||
changed_when: false
|
||||
|
||||
- name: Clone into /tmp
|
||||
ansible.builtin.git:
|
||||
dest: /tmp/dotfiles
|
||||
repo: "{{ dotfiles_repo_source }}"
|
||||
version: "{{ dotfiles_repo_commit }}"
|
||||
when: not dotfiles_repo_head.stat.exists
|
||||
|
||||
- name: Back up existing dotfiles
|
||||
ansible.builtin.shell:
|
||||
chdir: /tmp/dotfiles
|
||||
cmd: |
|
||||
git ls-files | while read -r line; do
|
||||
mv $HOME/$line $HOME/$line.bak
|
||||
done
|
||||
# when: # TODO only if bare repo doesnt already exist
|
||||
when: not dotfiles_repo_head.stat.exists
|
||||
- name: Initialize dotfiles repository in user home
|
||||
ansible.builtin.git:
|
||||
bare: true
|
||||
update: true
|
||||
dest: "{{ ansible_user_directory }}/{{ dotfiles_repo_destination }}"
|
||||
repo: "{{ dotfiles_repo_source }}"
|
||||
version: "{{ dotfiles_repo_commit }}"
|
||||
Reference in New Issue
Block a user