Updated arch config
This commit is contained in:
parent
7bacbc8662
commit
d2b7c0fd5d
@ -7,10 +7,11 @@
|
||||
become: yes
|
||||
roles:
|
||||
- user-account
|
||||
- sudo
|
||||
- dotfiles
|
||||
- git
|
||||
- tmux
|
||||
- zsh
|
||||
- neovim
|
||||
- vimwiki
|
||||
- tools
|
||||
- dev-machine
|
||||
|
@ -3,6 +3,7 @@
|
||||
package:
|
||||
name:
|
||||
- git
|
||||
- openssh
|
||||
state: latest
|
||||
|
||||
- name: clone dotfiles
|
||||
|
@ -3,7 +3,6 @@
|
||||
package:
|
||||
name:
|
||||
- git
|
||||
- git-flow
|
||||
state: latest
|
||||
|
||||
- name: install git config
|
||||
|
67
roles/neovim-appimage/tasks/main.yaml
Normal file
67
roles/neovim-appimage/tasks/main.yaml
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
- name: install prerequisites (apt)
|
||||
package:
|
||||
name:
|
||||
- nodejs
|
||||
- npm
|
||||
- python
|
||||
- python-pip
|
||||
- ripgrep
|
||||
state: latest
|
||||
|
||||
- name: install prerequisites (pip)
|
||||
become_user: "{{ account.name }}"
|
||||
pip:
|
||||
name:
|
||||
- pynvim
|
||||
state: latest
|
||||
extra_args: --user
|
||||
|
||||
- name: download neovim appimage
|
||||
get_url:
|
||||
url: https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
||||
dest: /tmp
|
||||
mode: "0755"
|
||||
|
||||
- name: extract neovim appimage
|
||||
shell: |
|
||||
rm -rf /usr/local/bin/nvim.appimage
|
||||
/tmp/nvim.appimage --appimage-extract
|
||||
mv squashfs-root /usr/local/bin/nvim.appimage
|
||||
chmod -R 4755 /usr/local/bin/nvim.appimage
|
||||
chmod -R -s /usr/local/bin/nvim.appimage
|
||||
rm -f /tmp/nvim.appimage
|
||||
args:
|
||||
chdir: /tmp
|
||||
|
||||
- name: install neovim link
|
||||
alternatives:
|
||||
name: nvim
|
||||
path: /usr/local/bin/nvim.appimage/usr/bin/nvim
|
||||
link: /usr/bin/nvim
|
||||
|
||||
- name: create nvim plugin directory
|
||||
become_user: "{{ account.name }}"
|
||||
file:
|
||||
path: "{{ account.home }}/.local/share/nvim/site/autoload/"
|
||||
state: directory
|
||||
|
||||
- name: install vim-plug
|
||||
become_user: "{{ account.name }}"
|
||||
get_url:
|
||||
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
dest: "{{ account.home }}/.local/share/nvim/site/autoload/plug.vim"
|
||||
|
||||
- name: install nvim config
|
||||
become_user: "{{ account.name }}"
|
||||
shell:
|
||||
chdir: "{{ dotfiles }}/nvim"
|
||||
cmd: ./install.sh
|
||||
creates: "{{ account.home }}/.config/nvim/init.vim"
|
||||
|
||||
- name: install nvim plugins
|
||||
become_user: "{{ account.name }}"
|
||||
shell:
|
||||
cmd: nvim +PlugInstall +PlugUpdate +qall
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
name:
|
||||
- nodejs
|
||||
- npm
|
||||
- python3
|
||||
- python
|
||||
- python-pip
|
||||
- ripgrep
|
||||
state: latest
|
||||
|
||||
@ -16,28 +17,11 @@
|
||||
state: latest
|
||||
extra_args: --user
|
||||
|
||||
- name: download neovim appimage
|
||||
get_url:
|
||||
url: https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
||||
dest: /tmp
|
||||
mode: "0755"
|
||||
|
||||
- name: extract neovim appimage
|
||||
shell: |
|
||||
rm -rf /usr/local/bin/nvim.appimage
|
||||
/tmp/nvim.appimage --appimage-extract
|
||||
mv squashfs-root /usr/local/bin/nvim.appimage
|
||||
chmod -R 4755 /usr/local/bin/nvim.appimage
|
||||
chmod -R -s /usr/local/bin/nvim.appimage
|
||||
rm -f /tmp/nvim.appimage
|
||||
args:
|
||||
chdir: /tmp
|
||||
|
||||
- name: install neovim link
|
||||
alternatives:
|
||||
name: nvim
|
||||
path: /usr/local/bin/nvim.appimage/usr/bin/nvim
|
||||
link: /usr/bin/nvim
|
||||
- name: install neovim
|
||||
package:
|
||||
name:
|
||||
- neovim
|
||||
state: latest
|
||||
|
||||
- name: create nvim plugin directory
|
||||
become_user: "{{ account.name }}"
|
||||
|
22
roles/sudo/tasks/main.yaml
Normal file
22
roles/sudo/tasks/main.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: install sudo
|
||||
package:
|
||||
name:
|
||||
- sudo
|
||||
state: latest
|
||||
|
||||
- name: add user to sudoer group
|
||||
user:
|
||||
name: "{{ account.name }}"
|
||||
groups: "{{ sudo_group }}"
|
||||
append: yes
|
||||
|
||||
- name: activate sudoers group
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
regexp: "^%{{ sudo_group }}"
|
||||
line: "%{{ sudo_group }} ALL=(ALL) ALL"
|
||||
insertafter: "^#\\s*%{{ sudo_group }}"
|
||||
firstmatch: true
|
||||
validate: "visudo -cf %s"
|
3
roles/sudo/vars/main.yaml
Normal file
3
roles/sudo/vars/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
sudo_group: "{{ 'sudo' if ansible_facts['os_family'] == 'Debian' else 'wheel' }}"
|
||||
|
@ -4,6 +4,7 @@
|
||||
name:
|
||||
- tree
|
||||
state: latest
|
||||
|
||||
- name: install debian tools
|
||||
package:
|
||||
name:
|
||||
|
@ -6,7 +6,6 @@
|
||||
create_home: yes
|
||||
state: present
|
||||
update_password: always
|
||||
groups: sudo
|
||||
register: account
|
||||
|
||||
- name: ensure .ssh exists
|
||||
@ -19,8 +18,20 @@
|
||||
- name: copy ssh key
|
||||
become_user: "{{ account.name }}"
|
||||
copy:
|
||||
src: "{{ item }}"
|
||||
src: "ssh/"
|
||||
dest: "/home/{{ account.name }}/.ssh/"
|
||||
mode: "0600"
|
||||
with_fileglob:
|
||||
- "/mnt/c/Users/mandl/.ssh/id_rsa*"
|
||||
|
||||
- name: ensure .gnupg exists
|
||||
become_user: "{{ account.name }}"
|
||||
file:
|
||||
path: "/home/{{ account.name }}/.gnupg"
|
||||
state: directory
|
||||
mode: "0700"
|
||||
|
||||
- name: copy gpg keys
|
||||
become_user: "{{ account.name }}"
|
||||
copy:
|
||||
src: "gnupg/"
|
||||
dest: "/home/{{ account.name }}/.gnupg/"
|
||||
mode: "0600"
|
||||
|
@ -14,7 +14,7 @@
|
||||
- git
|
||||
- tmux
|
||||
- zsh
|
||||
- neovim
|
||||
- neovim-appimage
|
||||
- vimwiki
|
||||
- tools
|
||||
- dev-machine
|
||||
|
Reference in New Issue
Block a user