Compare commits
12 Commits
ac2c5f6a07
...
f47b6c6bea
Author | SHA1 | Date | |
---|---|---|---|
f47b6c6bea | |||
a4b14b702e | |||
4ea69d1a3a | |||
c4d4629d8d | |||
640a892920 | |||
8c81fcd2a2 | |||
09f3981a23 | |||
7ea443bbc6 | |||
a7283dee69 | |||
712c75bb85 | |||
272aa5e11a | |||
2de9bd5bef |
159
.gitignore
vendored
Normal file
159
.gitignore
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
### Vagrant
|
||||
|
||||
# General
|
||||
.vagrant/
|
||||
|
||||
### Python
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
# PyCharm
|
||||
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
|
||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
21
combava.yml
Normal file
21
combava.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: Combava
|
||||
hosts: localhost
|
||||
become: true
|
||||
vars_files:
|
||||
- vars/users.yml
|
||||
vars:
|
||||
users:
|
||||
- "{{ me }}"
|
||||
- "{{ admin }}"
|
||||
pre_tasks:
|
||||
- name: update pacman cache
|
||||
community.general.pacman:
|
||||
update_cache: yes
|
||||
roles:
|
||||
- arch_aur
|
||||
- core
|
||||
- workstation
|
||||
- users
|
||||
- dotfiles
|
||||
#- gnome
|
73
roles/Vagrantfile
vendored
73
roles/Vagrantfile
vendored
@ -1,73 +0,0 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure("2") do |config|
|
||||
# The most common configuration options are documented and commented below.
|
||||
# For a complete reference, please see the online documentation at
|
||||
# https://docs.vagrantup.com.
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://vagrantcloud.com/search.
|
||||
config.vm.box = "archlinux/archlinux"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||
# NOTE: This will enable public access to the opened port
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine and only allow access
|
||||
# via 127.0.0.1 to disable public access
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
# using a specific IP.
|
||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||
|
||||
# Create a public network, which generally matched to bridged network.
|
||||
# Bridged networks make the machine appear as another physical device on
|
||||
# your network.
|
||||
# config.vm.network "public_network"
|
||||
|
||||
# Share an additional folder to the guest VM. The first argument is
|
||||
# the path on the host to the actual folder. The second argument is
|
||||
# the path on the guest to mount the folder. And the optional third
|
||||
# argument is a set of non-required options.
|
||||
# config.vm.synced_folder "../data", "/vagrant_data"
|
||||
|
||||
# Provider-specific configuration so you can fine-tune various
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
# Example for VirtualBox:
|
||||
#
|
||||
# config.vm.provider "virtualbox" do |vb|
|
||||
# # Display the VirtualBox GUI when booting the machine
|
||||
# vb.gui = true
|
||||
#
|
||||
# # Customize the amount of memory on the VM:
|
||||
# vb.memory = "1024"
|
||||
# end
|
||||
#
|
||||
# View the documentation for the provider you are using for more
|
||||
# information on available options.
|
||||
|
||||
# Enable provisioning with a shell script. Additional provisioners such as
|
||||
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
|
||||
# documentation for more information about their specific syntax and use.
|
||||
# config.vm.provision "shell", inline: <<-SHELL
|
||||
# apt-get update
|
||||
# apt-get install -y apache2
|
||||
# SHELL
|
||||
config.vm.provision "ansible" do |ansible|
|
||||
ansible.playbook = "vagrant_playbook.yml"
|
||||
end
|
||||
end
|
@ -20,7 +20,6 @@
|
||||
community.general.pacman:
|
||||
name: base-devel
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
# - name: Git clone ansible-aur
|
||||
# git:
|
||||
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
# handlers file for arch_pkg_install
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include arch_pkg_install"
|
||||
include_role:
|
||||
name: "arch_pkg_install"
|
Binary file not shown.
Binary file not shown.
@ -1,14 +0,0 @@
|
||||
---
|
||||
# tasks file for arch_pkg_install
|
||||
- name: Install pkgs
|
||||
community.general.pacman:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: pkgs
|
||||
|
||||
|
||||
- name: Install AUR pkgs
|
||||
kewlfft.aur.aur:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: aur_pkgs
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
# vars file for arch_pkg_install
|
35
roles/core/defaults/main.yml
Normal file
35
roles/core/defaults/main.yml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
# defaults file for core
|
||||
|
||||
pacman_base:
|
||||
- vim
|
||||
- tmux
|
||||
- git
|
||||
- gnupg
|
||||
- zsh
|
||||
- zsh-completions
|
||||
- sudo
|
||||
|
||||
pacman_admin:
|
||||
- pacman-contrib
|
||||
- wget
|
||||
- cronie
|
||||
- ruby
|
||||
- openssh
|
||||
- sshfs
|
||||
- htop
|
||||
- iotop
|
||||
- glances
|
||||
- nmap
|
||||
- sshpass
|
||||
- rsync
|
||||
- bind-tools
|
||||
- unzip
|
||||
- ntfs-3g
|
||||
- cifs-utils
|
||||
- traceroute
|
||||
- smartmontools
|
||||
|
||||
pacman_pkgs:
|
||||
- "{{ pacman_base }}"
|
||||
- "{{ pacman_admin }}"
|
2
roles/core/handlers/main.yml
Normal file
2
roles/core/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for core
|
52
roles/core/meta/main.yml
Normal file
52
roles/core/meta/main.yml
Normal file
@ -0,0 +1,52 @@
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
#
|
||||
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||
# To view available platforms and versions (or releases), visit:
|
||||
# https://galaxy.ansible.com/api/v1/platforms/
|
||||
#
|
||||
# platforms:
|
||||
# - name: Fedora
|
||||
# versions:
|
||||
# - all
|
||||
# - 25
|
||||
# - name: SomePlatform
|
||||
# versions:
|
||||
# - all
|
||||
# - 1.0
|
||||
# - 7
|
||||
# - 99.99
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
7
roles/core/molecule/default/converge.yml
Normal file
7
roles/core/molecule/default/converge.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include core"
|
||||
include_role:
|
||||
name: "core"
|
8
roles/core/tasks/main.yml
Normal file
8
roles/core/tasks/main.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
# tasks file for core
|
||||
- name: Install pkgs
|
||||
community.general.pacman:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ pacman_pkgs }}"
|
||||
|
@ -2,4 +2,4 @@
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- arch_pkg_install
|
||||
- core
|
2
roles/core/vars/main.yml
Normal file
2
roles/core/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for core
|
@ -1,7 +1,8 @@
|
||||
---
|
||||
user:
|
||||
username: 'vagrant'
|
||||
|
||||
dotusers: ["{{ user }}"]
|
||||
me:
|
||||
username: 'user1'
|
||||
|
||||
config2stow: ["nvim", "tmux", "zsh"]
|
||||
|
||||
autofs:
|
||||
- host: nas
|
||||
|
2
roles/dotfiles/files/autofs.nas
Normal file
2
roles/dotfiles/files/autofs.nas
Normal file
@ -0,0 +1,2 @@
|
||||
Nas_commun -rw,soft,intr,rsize=8192,wsize=8192 nas:/mnt/DocNas/Commun
|
||||
Nas_perso -rw,soft,intr,rsize=8192,wsize=8192 nas:/mnt/DocNas/Benjamin
|
@ -5,3 +5,4 @@
|
||||
- name: "Include dotfiles"
|
||||
include_role:
|
||||
name: "dotfiles"
|
||||
become: true
|
||||
|
@ -3,12 +3,10 @@
|
||||
community.general.pacman:
|
||||
name: stow
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
|
||||
- name: Install git
|
||||
community.general.pacman:
|
||||
name: git
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
|
42
roles/dotfiles/tasks/gnome.yml
Normal file
42
roles/dotfiles/tasks/gnome.yml
Normal file
@ -0,0 +1,42 @@
|
||||
---
|
||||
- name: <super + q> to close window
|
||||
dconf:
|
||||
key: "/org/gnome/desktop/wm/keybindings/close"
|
||||
value: "['<Super>q']"
|
||||
state: present
|
||||
|
||||
- name: <super + enter> to fire a terminal - binding
|
||||
dconf:
|
||||
key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding"
|
||||
value: "'<Super>Return'"
|
||||
state: present
|
||||
|
||||
- name: <super + enter> to fire a terminal - command
|
||||
dconf:
|
||||
key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command"
|
||||
value: "'urxvt'"
|
||||
state: present
|
||||
|
||||
- name: <super + enter> to fire a terminal - name
|
||||
dconf:
|
||||
key: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name"
|
||||
value: "'Terminal'"
|
||||
state: present
|
||||
|
||||
- name: Shell theme
|
||||
dconf:
|
||||
key: "/org/gnome/shell/extensions/user-theme/name"
|
||||
value: "'Materia-dark-compact'"
|
||||
state: present
|
||||
|
||||
- name: Gtk theme
|
||||
dconf:
|
||||
key: "/org/gnome/desktop/interface/gkt-theme"
|
||||
value: "'Materia-dark-compact'"
|
||||
state: present
|
||||
|
||||
- name: Icon theme
|
||||
dconf:
|
||||
key: "/org/gnome/desktop/interface/icon-theme"
|
||||
value: "'Tela-orange-dark'"
|
||||
state: present
|
18
roles/dotfiles/tasks/home_mounts.yml
Normal file
18
roles/dotfiles/tasks/home_mounts.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Create NAS share directory
|
||||
file:
|
||||
path: "/media/{{ item.host }}"
|
||||
state: directory
|
||||
with_items: "{{ autofs }}"
|
||||
|
||||
- name: Activate NAS shares for autofs
|
||||
lineinfile:
|
||||
path: /etc/autofs/auto.master
|
||||
line: "/media/{{ item.host }} /etc/autofs/auto.{{ item.host }} --timeout=60 --browse"
|
||||
with_items: "{{ autofs }}"
|
||||
|
||||
- name: NAS autofs config file
|
||||
template:
|
||||
src: "files/autofs.{{ item.host }}"
|
||||
dest: "/etc/autofs/auto.{{ item.host }}"
|
||||
with_items: "{{ autofs }}"
|
@ -10,11 +10,23 @@
|
||||
- name: Clone dotfiles
|
||||
ansible.builtin.git:
|
||||
repo: 'https://git.opytex.org/lafrite/dotfiles.git'
|
||||
dest: /home/{{ item.username }}/.dotfiles
|
||||
with_items: "{{ dotusers }}"
|
||||
dest: ~/.dotfiles
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- name: stow configs
|
||||
ansible.builtin.command:
|
||||
cmd: stow {{ item }}
|
||||
chdir: ~/.dotfiles/
|
||||
with_items: "{{ config2stow }}"
|
||||
become: true
|
||||
become_user: "{{ me.username}}"
|
||||
|
||||
- name: home mounts
|
||||
import_tasks: home_mounts.yml
|
||||
|
||||
- name: Gnome config
|
||||
import_tasks: gnome.yml
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
when: no # soucis avec la version de psutil
|
||||
|
@ -1,4 +1,19 @@
|
||||
---
|
||||
# defaults file for gnome
|
||||
me:
|
||||
username: user1
|
||||
pacman_gnome:
|
||||
- gnome
|
||||
- gdm
|
||||
- gnome-tweaks
|
||||
- gparted
|
||||
- transmission-gtk
|
||||
- quodlibet
|
||||
- networkmanager
|
||||
- network-manager-applet
|
||||
- gnome-keyring
|
||||
- grsync
|
||||
- soundconverter
|
||||
- picard
|
||||
- shotwell
|
||||
- pitivi
|
||||
- seahorse
|
||||
- python-psutil
|
||||
|
@ -2,26 +2,9 @@
|
||||
# tasks file for gnome
|
||||
- name: Install gnome packages
|
||||
pacman:
|
||||
name:
|
||||
- gnome
|
||||
- gdm
|
||||
- gnome-tweaks
|
||||
- gparted
|
||||
- transmission-gtk
|
||||
- quodlibet
|
||||
# - chrome-gnome-shell
|
||||
- networkmanager
|
||||
- network-manager-applet
|
||||
- gnome-keyring
|
||||
- grsync
|
||||
- soundconverter
|
||||
- picard
|
||||
- shotwell
|
||||
- pitivi
|
||||
- seahorse
|
||||
- python-psutil
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
with_items: "{{ pacman_gnome }}"
|
||||
|
||||
- name: Install look and feel
|
||||
pacman:
|
||||
@ -35,7 +18,6 @@
|
||||
- gnome-icon-theme
|
||||
- adwaita-icon-theme
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Install AUR Icons and gtk themes
|
||||
aur:
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
- name: "Include users"
|
||||
include_role:
|
||||
|
@ -1,8 +0,0 @@
|
||||
---
|
||||
- name: Test Vagrant
|
||||
hosts: all
|
||||
become: true
|
||||
roles:
|
||||
- arch_aur
|
||||
- users
|
||||
- gnome
|
29
roles/workstation/.travis.yml
Normal file
29
roles/workstation/.travis.yml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
# Use the new container infrastructure
|
||||
sudo: false
|
||||
|
||||
# Install ansible
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python-pip
|
||||
|
||||
install:
|
||||
# Install ansible
|
||||
- pip install ansible
|
||||
|
||||
# Check ansible version
|
||||
- ansible --version
|
||||
|
||||
# Create ansible.cfg with correct roles_path
|
||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||
|
||||
script:
|
||||
# Basic role syntax check
|
||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
33
roles/workstation/.yamllint
Normal file
33
roles/workstation/.yamllint
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
# Based on ansible-lint config
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
braces:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
brackets:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
colons:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
commas:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
comments: disable
|
||||
comments-indentation: disable
|
||||
document-start: disable
|
||||
empty-lines:
|
||||
max: 3
|
||||
level: error
|
||||
hyphens:
|
||||
level: error
|
||||
indentation: disable
|
||||
key-duplicates: enable
|
||||
line-length: disable
|
||||
new-line-at-end-of-file: disable
|
||||
new-lines:
|
||||
type: unix
|
||||
trailing-spaces: disable
|
||||
truthy: disable
|
38
roles/workstation/README.md
Normal file
38
roles/workstation/README.md
Normal file
@ -0,0 +1,38 @@
|
||||
Role Name
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
@ -1,48 +1,21 @@
|
||||
---
|
||||
# defaults file for arch_pkg_install
|
||||
|
||||
pacman_base:
|
||||
- vim
|
||||
- tmux
|
||||
- git
|
||||
- gnupg
|
||||
|
||||
pacman_admin:
|
||||
- pacman-contrib
|
||||
- sudo
|
||||
- wget
|
||||
- cronie
|
||||
- ruby
|
||||
- tig
|
||||
- openssh
|
||||
- sshfs
|
||||
- htop
|
||||
- ntop
|
||||
- iotop
|
||||
- glances
|
||||
- nmap
|
||||
# defaults file for workstation
|
||||
pacman_utils:
|
||||
- nfs-utils
|
||||
- samba
|
||||
- sshpass
|
||||
- rsync
|
||||
- autofs
|
||||
- bind-tools
|
||||
- unzip
|
||||
- ntfs-3g
|
||||
- git-annex
|
||||
- cifs-utils
|
||||
- traceroute
|
||||
- smartmontools
|
||||
- ripgrep
|
||||
- fzf
|
||||
|
||||
pacman_cli:
|
||||
- moc
|
||||
- pass
|
||||
- cups
|
||||
- cups-pdf
|
||||
- avahi
|
||||
- nss-mdns
|
||||
|
||||
pacman_cli:
|
||||
- git-annex
|
||||
- fzf
|
||||
- ripgrep
|
||||
- tig
|
||||
- moc
|
||||
- pass
|
||||
- task
|
||||
- profanity
|
||||
- neomutt
|
||||
- youtube-dl
|
||||
- neovim
|
||||
@ -105,20 +78,34 @@ pacman_fonts:
|
||||
- ttf-inconsolata
|
||||
- noto-fonts
|
||||
|
||||
pacman_programming:
|
||||
- pandoc
|
||||
- python
|
||||
- python-virtualenv
|
||||
- python-pip
|
||||
- python2
|
||||
- python2-virtualenv
|
||||
- python2-pip
|
||||
- graphviz
|
||||
- python-black
|
||||
- pyenv
|
||||
- nodejs
|
||||
- yarn
|
||||
|
||||
pkgs:
|
||||
- "{{ pacman_base }}"
|
||||
- "{{ pacman_admin }}"
|
||||
- "{{ pacman_cli }}"
|
||||
- "{{ pacman_terms }}"
|
||||
- "{{ pacman_office }}"
|
||||
- "{{ pacman_media }}"
|
||||
- "{{ pacman_work }}"
|
||||
- "{{ pacman_3Dprint }}"
|
||||
- "{{ pacman_fonts }}"
|
||||
pacman_pkgs:
|
||||
- "{{ pacman_utils }}"
|
||||
# - "{{ pacman_cli }}"
|
||||
# - "{{ pacman_terms }}"
|
||||
# - "{{ pacman_office }}"
|
||||
# - "{{ pacman_media }}"
|
||||
# - "{{ pacman_work }}"
|
||||
# - "{{ pacman_3Dprint }}"
|
||||
# - "{{ pacman_fonts }}"
|
||||
|
||||
# Packages to install from AUR
|
||||
aur_fonts:
|
||||
aur_utils:
|
||||
- autofs
|
||||
|
||||
aur_fonts:
|
||||
- ttf-ubuntu-mono-derivative-powerline-git
|
||||
- ttf-inconsolata-lgc-for-powerline
|
||||
- ttf-droid-sans-mono-slashed-powerline-git
|
||||
@ -132,5 +119,6 @@ aur_work:
|
||||
- perl-locale-codes
|
||||
|
||||
aur_pkgs:
|
||||
- "{{ aur_fonts }}"
|
||||
- "{{ aur_work }}"
|
||||
- "{{ aur_utils }}"
|
||||
# - "{{ aur_fonts }}"
|
||||
# - "{{ aur_work }}"
|
2
roles/workstation/handlers/main.yml
Normal file
2
roles/workstation/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for workstation
|
52
roles/workstation/meta/main.yml
Normal file
52
roles/workstation/meta/main.yml
Normal file
@ -0,0 +1,52 @@
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
#
|
||||
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||
# To view available platforms and versions (or releases), visit:
|
||||
# https://galaxy.ansible.com/api/v1/platforms/
|
||||
#
|
||||
# platforms:
|
||||
# - name: Fedora
|
||||
# versions:
|
||||
# - all
|
||||
# - 25
|
||||
# - name: SomePlatform
|
||||
# versions:
|
||||
# - all
|
||||
# - 1.0
|
||||
# - 7
|
||||
# - 99.99
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
23
roles/workstation/molecule/default/INSTALL.rst
Normal file
23
roles/workstation/molecule/default/INSTALL.rst
Normal file
@ -0,0 +1,23 @@
|
||||
*********************************
|
||||
Vagrant driver installation guide
|
||||
*********************************
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
* Vagrant
|
||||
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
|
||||
|
||||
Install
|
||||
=======
|
||||
|
||||
Please refer to the `Virtual environment`_ documentation for installation best
|
||||
practices. If not using a virtual environment, please consider passing the
|
||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
||||
|
||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ pip install 'molecule_vagrant'
|
7
roles/workstation/molecule/default/converge.yml
Normal file
7
roles/workstation/molecule/default/converge.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include workstation"
|
||||
include_role:
|
||||
name: "workstation"
|
11
roles/workstation/molecule/default/molecule.yml
Normal file
11
roles/workstation/molecule/default/molecule.yml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: vagrant
|
||||
platforms:
|
||||
- name: instance
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
name: testinfra
|
22
roles/workstation/molecule/default/tests/conftest.py
Normal file
22
roles/workstation/molecule/default/tests/conftest.py
Normal file
@ -0,0 +1,22 @@
|
||||
"""PyTest Fixtures."""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
"""Run tests only when under molecule with testinfra installed."""
|
||||
try:
|
||||
import testinfra
|
||||
except ImportError:
|
||||
pytest.skip("Test requires testinfra", allow_module_level=True)
|
||||
if "MOLECULE_INVENTORY_FILE" in os.environ:
|
||||
pytest.testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ["MOLECULE_INVENTORY_FILE"]
|
||||
).get_hosts("all")
|
||||
else:
|
||||
pytest.skip(
|
||||
"Test should run only from inside molecule.", allow_module_level=True
|
||||
)
|
10
roles/workstation/molecule/default/tests/test_default.py
Normal file
10
roles/workstation/molecule/default/tests/test_default.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""Role testing files using testinfra."""
|
||||
|
||||
|
||||
def test_hosts_file(host):
|
||||
"""Validate /etc/hosts file."""
|
||||
f = host.file("/etc/hosts")
|
||||
|
||||
assert f.exists
|
||||
assert f.user == "root"
|
||||
assert f.group == "root"
|
23
roles/workstation/tasks/arch.yml
Normal file
23
roles/workstation/tasks/arch.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
# tasks file for workstation
|
||||
- name: More colorfull pacman
|
||||
lineinfile:
|
||||
dest: /etc/pacman.conf
|
||||
regexp: '^#Color$'
|
||||
line: 'Color'
|
||||
backrefs: yes
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Install pkgs
|
||||
community.general.pacman:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ pacman_pkgs }}"
|
||||
|
||||
- name: Install AUR pkgs
|
||||
aur:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ aur_pkgs }}"
|
||||
become: yes
|
||||
become_user: aur_builder
|
36
roles/workstation/tasks/main.yml
Normal file
36
roles/workstation/tasks/main.yml
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
# tasks file for workstation
|
||||
- name: Install for arch
|
||||
import_tasks: arch.yml
|
||||
when: ansible_os_family == "Archlinux"
|
||||
|
||||
- name: enable service cups
|
||||
systemd:
|
||||
name: cups
|
||||
# name: org.cups.cups
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Set hostname resolution
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/nsswitch.conf
|
||||
regexp: "^hosts:"
|
||||
line: "hosts: files mymachines myhostname mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns"
|
||||
|
||||
- name: enable service avahi-daemon
|
||||
systemd:
|
||||
name: avahi-daemon
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: enable service nfs
|
||||
systemd:
|
||||
name: nfs-client.target
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Enable autofs daemon
|
||||
service:
|
||||
name: autofs
|
||||
state: started
|
||||
enabled: yes
|
2
roles/workstation/tests/inventory
Normal file
2
roles/workstation/tests/inventory
Normal file
@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
5
roles/workstation/tests/test.yml
Normal file
5
roles/workstation/tests/test.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- workstation
|
2
roles/workstation/vars/main.yml
Normal file
2
roles/workstation/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for workstation
|
14
vars/users.yml
Normal file
14
vars/users.yml
Normal file
@ -0,0 +1,14 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
63303466623263633539616565666333636165333836633033336165356132343330313165343632
|
||||
6265626135323761646136623161623930656639623164310a656633353463346362656662643537
|
||||
61653534386433363763643939343636623039393632663566363535626432666164646437363932
|
||||
6365666534326433320a336264346437353033346432386134653832343234666565336439333834
|
||||
32663035333465326337653931343962333662656465653863303938363432623832303937343237
|
||||
33313939356361643235313735336361316631633933613134323833373034343365646131333062
|
||||
66396161313233333261366662376332343963323432396464663037393265373233346361623530
|
||||
31366363373033383236353830333238306232343331313439393436613035323337626361623639
|
||||
32646564336435663137656436326237643636646430333336366637666630363762643165393237
|
||||
34343238346230326435363435313165386434376465343932383966326138643766353033643935
|
||||
30663762613166373233333062636563623363346666333363313835376536613736386566623836
|
||||
65333839353038386539323963336464326264353631666262333136666532313430316535663731
|
||||
31643262663436323461396363343564313636373237333932663930666262303838
|
Loading…
Reference in New Issue
Block a user