Split misc role into actual steps

This commit is contained in:
Michael Mandl 2020-05-31 17:27:58 +02:00
parent 5a647e07bf
commit 85f0dd8870
8 changed files with 88 additions and 70 deletions

View File

@ -0,0 +1,16 @@
---
- name: install required packages
package:
name:
- git
state: latest
- name: clone dotfiles
become_user: "{{ account.name }}"
git:
repo: git@github.com:mandlm/dotfiles.git
dest: "{{ dotfiles }}"
accept_hostkey: yes
update: no

14
roles/git/tasks/main.yaml Normal file
View File

@ -0,0 +1,14 @@
---
- name: install required packages
package:
name:
- git
state: latest
- name: install git config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/git"
cmd: ./install.sh
creates: "{{ account.home }}/.gitconfig"

View File

@ -1,47 +0,0 @@
---
- name: install basic packages
package:
name:
- aptitude
- git
- tmux
- tree
state: latest
- name: clone dotfiles
become_user: "{{ account.name }}"
git:
repo: git@github.com:mandlm/dotfiles.git
dest: "{{ dotfiles }}"
accept_hostkey: yes
update: no
- name: install zsh config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/zsh"
cmd: ./install.sh
creates: "{{ account.home }}/.zshrc"
- name: install tmux plugin manager
become_user: "{{ account.name }}"
git:
repo: https://github.com/tmux-plugins/tpm.git
dest: "{{ account.home }}/.tmux/plugins/tpm"
accept_hostkey: yes
update: no
- name: install tmux config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/tmux"
cmd: ./install.sh
creates: "{{ account.home }}/.tmux.conf"
- name: install git config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/git"
cmd: ./install.sh
creates: "{{ account.home }}/.gitconfig"

View File

@ -1,13 +0,0 @@
---
- name: install required packages
package:
name:
- curl
state: latest
- name: install oh-my-zsh
become_user: "{{ account.name }}"
shell:
cmd: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --keep-zshrc"
creates: "{{ account.home }}/.oh-my-zsh"

View File

@ -0,0 +1,22 @@
---
- name: install required packages
package:
name:
- tmux
state: latest
- name: install tmux plugin manager
become_user: "{{ account.name }}"
git:
repo: https://github.com/tmux-plugins/tpm.git
dest: "{{ account.home }}/.tmux/plugins/tpm"
accept_hostkey: yes
update: no
- name: install tmux config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/tmux"
cmd: ./install.sh
creates: "{{ account.home }}/.tmux.conf"

View File

@ -1,18 +1,10 @@
---
- name: install required packages
package:
name:
- zsh
state: latest
- name: setup user account
user:
name: "{{ username }}"
password: "{{ password }}"
generate_ssh_key: yes
create_home: yes
shell: /usr/bin/zsh
state: present
update_password: always
register: account

25
roles/zsh/tasks/main.yaml Normal file
View File

@ -0,0 +1,25 @@
---
- name: install required packages
package:
name:
- curl
- zsh
state: latest
- name: install zsh config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/zsh"
cmd: ./install.sh
creates: "{{ account.home }}/.zshrc"
- name: install oh-my-zsh
become_user: "{{ account.name }}"
shell:
cmd: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --unattended --keep-zshrc"
creates: "{{ account.home }}/.oh-my-zsh"
- name: change login shell to zsh
user:
name: "{{ username }}"
shell: /usr/bin/zsh

View File

@ -10,6 +10,15 @@
- update-packages
- user-account
- github-auth
- misc
- oh-my-zsh
- dotfiles
- git
- tmux
- zsh
- neovim
tasks:
- name: install tools
package:
name:
- aptitude
- tree
state: latest