Updated arch config
This commit is contained in:
parent
7bacbc8662
commit
d2b7c0fd5d
@ -7,10 +7,11 @@
|
|||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
- user-account
|
- user-account
|
||||||
|
- sudo
|
||||||
- dotfiles
|
- dotfiles
|
||||||
- git
|
- git
|
||||||
- tmux
|
- tmux
|
||||||
- zsh
|
- zsh
|
||||||
- neovim
|
- neovim
|
||||||
|
- vimwiki
|
||||||
- tools
|
- tools
|
||||||
- dev-machine
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- git
|
- git
|
||||||
|
- openssh
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: clone dotfiles
|
- name: clone dotfiles
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- git
|
- git
|
||||||
- git-flow
|
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: install git config
|
- 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:
|
name:
|
||||||
- nodejs
|
- nodejs
|
||||||
- npm
|
- npm
|
||||||
- python3
|
- python
|
||||||
|
- python-pip
|
||||||
- ripgrep
|
- ripgrep
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
@ -16,28 +17,11 @@
|
|||||||
state: latest
|
state: latest
|
||||||
extra_args: --user
|
extra_args: --user
|
||||||
|
|
||||||
- name: download neovim appimage
|
- name: install neovim
|
||||||
get_url:
|
package:
|
||||||
url: https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
name:
|
||||||
dest: /tmp
|
- neovim
|
||||||
mode: "0755"
|
state: latest
|
||||||
|
|
||||||
- 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
|
- name: create nvim plugin directory
|
||||||
become_user: "{{ account.name }}"
|
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:
|
name:
|
||||||
- tree
|
- tree
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: install debian tools
|
- name: install debian tools
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
create_home: yes
|
create_home: yes
|
||||||
state: present
|
state: present
|
||||||
update_password: always
|
update_password: always
|
||||||
groups: sudo
|
|
||||||
register: account
|
register: account
|
||||||
|
|
||||||
- name: ensure .ssh exists
|
- name: ensure .ssh exists
|
||||||
@ -19,8 +18,20 @@
|
|||||||
- name: copy ssh key
|
- name: copy ssh key
|
||||||
become_user: "{{ account.name }}"
|
become_user: "{{ account.name }}"
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "ssh/"
|
||||||
dest: "/home/{{ account.name }}/.ssh/"
|
dest: "/home/{{ account.name }}/.ssh/"
|
||||||
mode: "0600"
|
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
|
- git
|
||||||
- tmux
|
- tmux
|
||||||
- zsh
|
- zsh
|
||||||
- neovim
|
- neovim-appimage
|
||||||
- vimwiki
|
- vimwiki
|
||||||
- tools
|
- tools
|
||||||
- dev-machine
|
- dev-machine
|
||||||
|
Reference in New Issue
Block a user