Split misc role into actual steps
This commit is contained in:
parent
5a647e07bf
commit
85f0dd8870
8 changed files with 88 additions and 70 deletions
16
roles/dotfiles/tasks/main.yaml
Normal file
16
roles/dotfiles/tasks/main.yaml
Normal 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
14
roles/git/tasks/main.yaml
Normal 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"
|
||||||
|
|
|
@ -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"
|
|
||||||
|
|
|
@ -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"
|
|
||||||
|
|
22
roles/tmux/tasks/main.yaml
Normal file
22
roles/tmux/tasks/main.yaml
Normal 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"
|
||||||
|
|
|
@ -1,18 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: install required packages
|
|
||||||
package:
|
|
||||||
name:
|
|
||||||
- zsh
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- name: setup user account
|
- name: setup user account
|
||||||
user:
|
user:
|
||||||
name: "{{ username }}"
|
name: "{{ username }}"
|
||||||
password: "{{ password }}"
|
password: "{{ password }}"
|
||||||
generate_ssh_key: yes
|
generate_ssh_key: yes
|
||||||
create_home: yes
|
create_home: yes
|
||||||
shell: /usr/bin/zsh
|
|
||||||
state: present
|
state: present
|
||||||
update_password: always
|
update_password: always
|
||||||
register: account
|
register: account
|
||||||
|
|
||||||
|
|
25
roles/zsh/tasks/main.yaml
Normal file
25
roles/zsh/tasks/main.yaml
Normal 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
|
|
@ -10,6 +10,15 @@
|
||||||
- update-packages
|
- update-packages
|
||||||
- user-account
|
- user-account
|
||||||
- github-auth
|
- github-auth
|
||||||
- misc
|
- dotfiles
|
||||||
- oh-my-zsh
|
- git
|
||||||
|
- tmux
|
||||||
|
- zsh
|
||||||
- neovim
|
- neovim
|
||||||
|
tasks:
|
||||||
|
- name: install tools
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- aptitude
|
||||||
|
- tree
|
||||||
|
state: latest
|
||||||
|
|
Loading…
Reference in a new issue