7 Commits

20 changed files with 217 additions and 86 deletions

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew_cask:
name: 1password
state: latest

View File

@@ -0,0 +1 @@
# TODO: https://support.1password.com/install-linux/#debian-or-ubuntu

View File

@@ -0,0 +1,12 @@
---
- name: install chocolatey package
win_chocolatey:
name:
- 1password
state: latest
- name: create start menu shortcut
win_shortcut:
src: '{{ansible_env.LOCALAPPDATA}}/1Password/app/7/1Password.exe'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/1Password.lnk'
icon: '{{ansible_env.LOCALAPPDATA}}/1Password/app/7/1Password.exe,0'

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,14 @@
---
- name: install chocolatey package
win_chocolatey:
name: autohotkey
state: latest
- name: clone config repo
win_git:
repo: git@code.infektor.net:config/AutoHotKey.git
dest: '{{ansible_env.LOCALAPPDATA}}/AutoHotKey'
branch: master
# TODO: - name: create scheduled task
# win_scheduled_task:

View File

@@ -8,16 +8,4 @@
- the_silver_searcher - the_silver_searcher
state: latest state: latest
- name: clone config repo - include_tasks: unix.yaml
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user

View File

@@ -0,0 +1,11 @@
---
- name: install Debian-unstable apt packages
become: true
apt:
name:
- neovim
- clang-format
- clang-tidy
- clangd
- silversearcher-ag
state: latest

View File

@@ -1,28 +1,6 @@
--- ---
- name: install apt package - include_tasks: '{{ansible_distribution}}-{{ansible_distribution_version}}.yaml'
become: true - include_tasks: 'unix.yaml'
apt:
name:
- neovim
- clang-format
- clang-tidy
- clangd
- silversearcher-ag
state: latest
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user
- name: nodejs get json containing latest version - name: nodejs get json containing latest version
uri: uri:

View File

@@ -0,0 +1,34 @@
---
- name: get releases json from github
uri:
url: https://api.github.com/repos/neovim/neovim/releases
register: releases
- name: query the latest stable release
set_fact:
stable: '{{releases.json | json_query("[?tag_name==`stable`]")}}'
- name: query the nvim-linux64.deb.sha256sum asset
set_fact:
sha_asset: '{{stable[0].assets | json_query("[?name==`nvim-linux64.deb.sha256sum`]")}}'
- name: query the nvim-linux64.deb asset
set_fact:
deb_asset: '{{stable[0].assets | json_query("[?name==`nvim-linux64.deb`]")}}'
- name: create directory for downloads
file:
state: directory
path: ~/.cache/nvim/deb
- name: download nvim-linux64.deb with checksum
get_url:
url: '{{deb_asset[0].browser_download_url}}'
dest: ~/.cache/nvim/deb/nvim-linux64.deb
checksum: 'sha256:{{sha_asset[0].browser_download_url}}'
- name: install nvim-linux64.deb package
become: true
apt:
deb: ~/.cache/nvim/deb/nvim-linux64.deb
# TODO: clangd, clang-format, clang-tidy
- name: install Ubuntu-18.04 apt packages
become: true
apt:
name:
- silversearcher-ag

View File

@@ -18,3 +18,11 @@
# win_git_config: # win_git_config:
# TODO: - name: neovim install pip packages # TODO: - name: neovim install pip packages
# win_pip: # win_pip:
# name: '{{neovim_pip_packages}}'
# state: latest
- name: create nvim start menu shortcut
win_shortcut:
src: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/nvim.lnk'
icon: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe,0'

View File

@@ -0,0 +1,14 @@
---
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user

View File

@@ -0,0 +1,16 @@
---
- name: clone config repos
win_git:
repo: git@code.infektor.net:config/WindowsPowerShell.git
dest: '{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
branch: master
- name: install chocolatey package
win_chocolatey:
name: Cmder
state: latest
- name: install PsReadline module
win_psmodule:
name: PsReadline
state: latest

View File

@@ -0,0 +1,6 @@
---
- name: install homebrew packages
homebrew:
name:
- python
state: latest

View File

@@ -0,0 +1,8 @@
---
- name: install apt packages
apt:
name:
- python3
- python3-pip
- python3-virtualenv
- python-is-python3

View File

@@ -0,0 +1,13 @@
---
- name: install chocolatey packages
win_chocolatey:
name:
- python
state: latest
# TODO: - name: install config repo
# TODO: - name: set repo email
# TODO: - name: install pip packages
# TODO: - name: create config directories/files
# TODO: https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation

View File

@@ -1,44 +1,5 @@
--- ---
- name: install config repo - include_tasks: '{{ansible_os_family}}.yaml'
git:
repo: git@code.infektor.net:config/python.git
dest: ~/.config/python
# TODO: set repo email - include_tasks: 'unix.yaml'
when: ansible_os_family != "Windows"
- name: install pip packages
pip:
name:
- flake8
- grip
- ipdb
- ipython
- isort
- pylint
- python-gist
- yapf
state: latest
extra_args: --user
- name: create directories
file:
state: directory
dest: '{{item}}'
with_items:
- ~/.config/ipython/profile_default
- ~/.config/pip
- name: create symbolic links
file:
state: link
src: '{{item.src}}'
dest: '{{item.dest}}'
with_items:
- src: ~/.config/python/flake8
dest: ~/.config/flake8
- src: ~/.config/python/pylintrc
dest: ~/.pylintrc
- src: ~/.config/python/ipython_config.py
dest: ~/.config/ipython/profile_default/ipython_config.py
- src: ~/.config/python/pip.conf
dest: ~/.config/pip/pip.conf

View File

@@ -0,0 +1,36 @@
---
- name: install config repo
git:
repo: git@code.infektor.net:config/python.git
dest: ~/.config/python
# TODO: set repo email
- name: install pip packages
pip:
name: '{{python_pip_packages}}'
state: latest
extra_args: --user
- name: create directories
file:
state: directory
dest: '{{item}}'
with_items:
- ~/.config/ipython/profile_default
- ~/.config/pip
- name: create symbolic links
file:
state: link
src: '{{item.src}}'
dest: '{{item.dest}}'
with_items:
- src: ~/.config/python/flake8
dest: ~/.config/flake8
- src: ~/.config/python/pylintrc
dest: ~/.pylintrc
- src: ~/.config/python/ipython_config.py
dest: ~/.config/ipython/profile_default/ipython_config.py
- src: ~/.config/python/pip.conf
dest: ~/.config/pip/pip.conf

View File

@@ -0,0 +1,10 @@
---
python_pip_packages:
- flake8
- grip
- ipdb
- ipython
- isort
- pylint
- python-gist
- yapf

View File

@@ -1,15 +1,9 @@
--- ---
- hosts: localhost - hosts: localhost
roles: roles:
- role: zsh - role: zsh
- role: tmux - role: tmux
- role: neovim - role: neovim
- role: git - role: git
- role: python - role: python
- role: wsl
when: '"WSL" in ansible_kernel'
- hosts: windows
roles:
- role: neovim
- role: git

20
windows.yaml Normal file
View File

@@ -0,0 +1,20 @@
---
- import_playbook: unix.yaml
- hosts: localhost
# FIXME: Roles which depend on the win_git module can't be in the same
# playbook on the first run because the wsl role hasn't added the win_git
# module to the modules path yet.
roles:
- role: wsl
- hosts: windows
roles:
- role: powershell
- role: neovim
- role: git
- role: python
- role: autohotkey
- role: 1password