Feat: init refact with test
This commit is contained in:
1
roles/.vagrant/bundler/global.sol
Normal file
1
roles/.vagrant/bundler/global.sol
Normal file
@@ -0,0 +1 @@
|
||||
{"dependencies":[["racc",["~> 1.4"]],["nokogiri",["~> 1.6"]],["rexml",[">= 0"]],["formatador",["~> 0.2"]],["excon",["~> 0.71"]],["mime-types-data",["~> 3.2015"]],["mime-types",[">= 0"]],["builder",[">= 0"]],["fog-core",["~> 2.1"]],["json",[">= 0"]],["ruby-libvirt",[">= 0.7.0"]],["fog-xml",["~> 0.1.1"]],["multi_json",["~> 1.10"]],["fog-json",[">= 0"]],["fog-libvirt",[">= 0.6.0"]],["vagrant-libvirt",["= 0.7.0"]]],"checksum":"8fb75bcc7ceadece358816f104fd6957b12a29b3415d84307b15e0266c9c38e6","vagrant_version":"2.2.19"}
|
||||
@@ -0,0 +1 @@
|
||||
1.5:88d04ce1-4b15-4a61-9633-872ba9382671
|
||||
@@ -0,0 +1 @@
|
||||
1641372873
|
||||
1
roles/.vagrant/machines/default/virtualbox/box_meta
Normal file
1
roles/.vagrant/machines/default/virtualbox/box_meta
Normal file
@@ -0,0 +1 @@
|
||||
{"name":"archlinux/archlinux","version":"20211201.40458","provider":"virtualbox","directory":"boxes/archlinux-VAGRANTSLASH-archlinux/20211201.40458/virtualbox"}
|
||||
1
roles/.vagrant/machines/default/virtualbox/creator_uid
Normal file
1
roles/.vagrant/machines/default/virtualbox/creator_uid
Normal file
@@ -0,0 +1 @@
|
||||
1000
|
||||
1
roles/.vagrant/machines/default/virtualbox/id
Normal file
1
roles/.vagrant/machines/default/virtualbox/id
Normal file
@@ -0,0 +1 @@
|
||||
88d04ce1-4b15-4a61-9633-872ba9382671
|
||||
1
roles/.vagrant/machines/default/virtualbox/index_uuid
Normal file
1
roles/.vagrant/machines/default/virtualbox/index_uuid
Normal file
@@ -0,0 +1 @@
|
||||
6de8af4689ef4d91bedd37146eaa50e7
|
||||
27
roles/.vagrant/machines/default/virtualbox/private_key
Normal file
27
roles/.vagrant/machines/default/virtualbox/private_key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEA4c9PfVN1TDwLYPPo0jhpVCNN0Sgencxm4O2QiUwH5Evl4R9q
|
||||
m3t9n8kfGrvT3AzMxt91HB9NgfdxU9k30t5Bk43yeSyCdAFBKvBCFG6QYq7ZoEVh
|
||||
BSrsIvr1TSjmlAjdlPjWJ+fRiZd6aM4HPHbEhXUQ0M5GQvTUw8uM25HdMp+IUFDf
|
||||
wsflqwSX4Ap3oMteY7+Url0b1UsbiTdWevaim1ujuTECWU5Z4KNHn29YteTxujUT
|
||||
uk7+tpEmU7/1F8jvzxHLxrj25XS0/HwhXhSCQ36vNiOZPakBvLM8b/Qf9LQRKm3T
|
||||
XhE3vtk8ijTX7yj5BOXVmsy0fIrqwCUzW/PPwQIDAQABAoIBAASXx+EfsnITgpO9
|
||||
Qk4MUbAha7LGYyEIiEso6dixEDQHiyxyDCQPdfWrDJPpoByIsh2Va/dfd58eHlL7
|
||||
RxRl6uWKbJUkX57ma6Ho8x8hRJSNQ+Xro1aMkfMAMb8ZBt+Z8o/WI9z57RwkVZwO
|
||||
HL2RGNwyDl6A45L3EeDNohbRN7OQ21QBLyHCjpvyo+l7HeLzmlvmo/BjBN0SG+mF
|
||||
ofFBF38V2PQG3pZbcay7PtjD7MpEKYGPVlwmajMEZzU0Gponun2zXVspbzRAw8tq
|
||||
Dw1Eu9gjLLEfexaYSTrJBr6hghtxDr/AvlJnUMfzKxhAMkfBdzsSf1GLZoImQc8L
|
||||
fTAOZvECgYEA/oSx99jo9v8OdxGC97+wtYE85guH0VZX+14jcjhSyYNT6gxKWolK
|
||||
KfbyJ6JTaHaSR6AZXeLmPk6ELZf7yT67VCz7Q4uF+2y2BThy2yQEACifocLDAuNw
|
||||
E0KQ/alVnxQGGy3MdqgZjc3zKNtYnfP9EbgIKYtSBBX5xbLvcN+pIC0CgYEA4x/U
|
||||
2F5PySAaQpV8Skjoebx8Lus+Sw4H3sAxww7HzxLHYb3V1FL8sO93+cTiBnz6wAyA
|
||||
vjKs3I314fSNeZPaNP9CTuZaqnzIqfhNK3gjHX8d4pEcj87qaukWnt2dyRjq/tuA
|
||||
5ES6jp6FFYXl60AqXqaaw6yg5X4KuBo2Sor3VmUCgYEA8mzD8vYZWAIy7fixDXf5
|
||||
Qbjan6eF8z/Rx6ywCIBbYnODfx+7xqaUDIqZtmSoG40s4ao93y5a7iftQFxOSC5H
|
||||
UfMSVRDVSlkOusQ8qjyQzvHisroG835c5wt1fRdIZaA1/LdP1AljZa0wGc9rhe+7
|
||||
MaBfrep08U1ZPhSkepeeyPUCgYB8y7697IRWdMc5Er4qawkh6skpVqTxxJHaeSxe
|
||||
iz6KrzzSneZiNf8WkV4Q5Xd0LTPyVmxfFaUZwv752s/pn63kNOWQSM5Eoy/3BLIS
|
||||
Un6o9HHNTgKtmfoAKHb/b7IFDyYAR0f5JTKEruFdRCdjLeyZ+V1Maww1TR5CrlRq
|
||||
fRUOaQKBgQCGrP7IZ1mK/CR/vOW3Uq4J6q4/PgvKEnUDbIARUVA8ACMklELjcGNH
|
||||
oiFc/gaQSS9u1typz2OpqCZZuA7kuPjD4B7okfrYOjJtNRfaaAe0eVkZ06IhfxgM
|
||||
4T8xIVSuP78ZoPmfXKFoHU1vEgWiQ5YpSe18t+4IrmozRHS+QuCK+A==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -0,0 +1 @@
|
||||
{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"/media/documents/scripts/test_ansible/roles","disabled":false,"__vagrantfile":true}}}
|
||||
1
roles/.vagrant/machines/default/virtualbox/vagrant_cwd
Normal file
1
roles/.vagrant/machines/default/virtualbox/vagrant_cwd
Normal file
@@ -0,0 +1 @@
|
||||
/media/documents/scripts/test_ansible/roles
|
||||
@@ -0,0 +1,3 @@
|
||||
# Generated by Vagrant
|
||||
|
||||
default ansible_host=127.0.0.1 ansible_port=2222 ansible_user='vagrant' ansible_ssh_private_key_file='/media/documents/scripts/test_ansible/roles/.vagrant/machines/default/virtualbox/private_key'
|
||||
9
roles/.vagrant/rgloader/loader.rb
Normal file
9
roles/.vagrant/rgloader/loader.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
# This file loads the proper rgloader/loader.rb file that comes packaged
|
||||
# with Vagrant so that encoded files can properly run with Vagrant.
|
||||
|
||||
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
|
||||
require File.expand_path(
|
||||
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
|
||||
else
|
||||
raise "Encoded files can't be read outside of the Vagrant installer."
|
||||
end
|
||||
73
roles/Vagrantfile
vendored
Normal file
73
roles/Vagrantfile
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# -*- 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
|
||||
29
roles/arch_aur/.travis.yml
Normal file
29
roles/arch_aur/.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/arch_aur/.yamllint
Normal file
33
roles/arch_aur/.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/arch_aur/README.md
Normal file
38
roles/arch_aur/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).
|
||||
2
roles/arch_aur/defaults/main.yml
Normal file
2
roles/arch_aur/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for arch_aur
|
||||
2
roles/arch_aur/handlers/main.yml
Normal file
2
roles/arch_aur/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for arch_aur
|
||||
23
roles/arch_aur/molecule/default/INSTALL.rst
Normal file
23
roles/arch_aur/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/arch_aur/molecule/default/converge.yml
Normal file
7
roles/arch_aur/molecule/default/converge.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include arch_aur"
|
||||
include_role:
|
||||
name: "arch_aur"
|
||||
11
roles/arch_aur/molecule/default/molecule.yml
Normal file
11
roles/arch_aur/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
|
||||
Binary file not shown.
Binary file not shown.
22
roles/arch_aur/molecule/default/tests/conftest.py
Normal file
22
roles/arch_aur/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/arch_aur/molecule/default/tests/test_default.py
Normal file
10
roles/arch_aur/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"
|
||||
47
roles/arch_aur/tasks/main.yml
Normal file
47
roles/arch_aur/tasks/main.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
# tasks file for arch_aur
|
||||
- name: Create the `aur_builder` user
|
||||
become: yes
|
||||
ansible.builtin.user:
|
||||
name: aur_builder
|
||||
create_home: yes
|
||||
group: wheel
|
||||
|
||||
- name: Allow the `aur_builder` user to run `sudo pacman` without a password
|
||||
become: yes
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/sudoers.d/11-install-aur_builder
|
||||
line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
|
||||
create: yes
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- name: Install base-devel
|
||||
pacman:
|
||||
name: base-devel
|
||||
state: present
|
||||
|
||||
# - name: Git clone ansible-aur
|
||||
# git:
|
||||
# repo: https://github.com/kewlfft/ansible-aur.git
|
||||
# dest: ~/.ansible/plugins/modules/aur
|
||||
# version: master
|
||||
# accept_hostkey: yes
|
||||
# become: yes
|
||||
# become_user: aur_builder
|
||||
|
||||
- name: Install Yay
|
||||
aur:
|
||||
name: yay
|
||||
use: makepkg
|
||||
state: present
|
||||
become: yes
|
||||
become_user: aur_builder
|
||||
|
||||
- name: Install mkpasswd
|
||||
aur:
|
||||
name: mkpasswd
|
||||
use: makepkg
|
||||
state: present
|
||||
become: yes
|
||||
become_user: aur_builder
|
||||
|
||||
2
roles/arch_aur/tests/inventory
Normal file
2
roles/arch_aur/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/arch_aur/tests/test.yml
Normal file
5
roles/arch_aur/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- arch_aur
|
||||
2
roles/arch_aur/vars/main.yml
Normal file
2
roles/arch_aur/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for arch_aur
|
||||
29
roles/arch_pkg_install/.travis.yml
Normal file
29
roles/arch_pkg_install/.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/arch_pkg_install/.yamllint
Normal file
33
roles/arch_pkg_install/.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/arch_pkg_install/README.md
Normal file
38
roles/arch_pkg_install/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).
|
||||
136
roles/arch_pkg_install/defaults/main.yml
Normal file
136
roles/arch_pkg_install/defaults/main.yml
Normal file
@@ -0,0 +1,136 @@
|
||||
---
|
||||
# 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
|
||||
- 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
|
||||
- task
|
||||
- profanity
|
||||
- neomutt
|
||||
- youtube-dl
|
||||
- neovim
|
||||
- python-pynvim
|
||||
|
||||
pacman_terms:
|
||||
- rxvt-unicode
|
||||
- xdotool
|
||||
- alacritty
|
||||
|
||||
pacman_office:
|
||||
- gimp
|
||||
- firefox
|
||||
- firefox-i18n-fr
|
||||
- chromium
|
||||
- inkscape
|
||||
- pstoedit # Enable latex in inkscape
|
||||
- thunderbird
|
||||
- thunderbird-i18n-fr
|
||||
- libreoffice-fresh
|
||||
- libreoffice-fresh-fr
|
||||
- geogebra
|
||||
- zathura
|
||||
- zathura-ps
|
||||
- zathura-djvu
|
||||
- zathura-cb
|
||||
- zathura-pdf-mupdf
|
||||
- scribus
|
||||
- nextcloud-client
|
||||
- hunspell
|
||||
- hunspell-fr
|
||||
|
||||
pacman_work:
|
||||
- texlive-most
|
||||
- gnuplot
|
||||
- auto-multiple-choice
|
||||
- xournalpp
|
||||
|
||||
pacman_media:
|
||||
- vlc
|
||||
- mpv
|
||||
- mplayer
|
||||
- guvcview
|
||||
|
||||
pacman_3Dprint:
|
||||
- openscad
|
||||
- cura
|
||||
|
||||
pacman_fonts:
|
||||
- awesome-terminal-fonts
|
||||
- cantarell-fonts
|
||||
- gnu-free-fonts
|
||||
- gsfonts
|
||||
- ttf-bitstream-vera
|
||||
- ttf-dejavu
|
||||
- ttf-droid
|
||||
- ttf-roboto
|
||||
- ttf-liberation
|
||||
- ttf-ubuntu-font-family
|
||||
- ttf-inconsolata
|
||||
- noto-fonts
|
||||
|
||||
|
||||
pkgs:
|
||||
- "{{ pacman_base }}"
|
||||
- "{{ pacman_admin }}"
|
||||
- "{{ pacman_cli }}"
|
||||
- "{{ pacman_terms }}"
|
||||
- "{{ pacman_office }}"
|
||||
- "{{ pacman_media }}"
|
||||
- "{{ pacman_work }}"
|
||||
- "{{ pacman_3Dprint }}"
|
||||
- "{{ pacman_fonts }}"
|
||||
|
||||
# Packages to install from AUR
|
||||
aur_fonts:
|
||||
- ttf-ubuntu-mono-derivative-powerline-git
|
||||
- ttf-inconsolata-lgc-for-powerline
|
||||
- ttf-droid-sans-mono-slashed-powerline-git
|
||||
- ttf-literation-mono-powerline-git
|
||||
- ttf-opendyslexic
|
||||
- nerd-fonts-ubuntu-mono
|
||||
- nerd-fonts-droid-sans-mono
|
||||
- nerd-fonts-hack
|
||||
|
||||
aur_work:
|
||||
- perl-locale-codes
|
||||
|
||||
aur_pkgs:
|
||||
- "{{ aur_fonts }}"
|
||||
- "{{ aur_work }}"
|
||||
2
roles/arch_pkg_install/handlers/main.yml
Normal file
2
roles/arch_pkg_install/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for arch_pkg_install
|
||||
23
roles/arch_pkg_install/molecule/default/INSTALL.rst
Normal file
23
roles/arch_pkg_install/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/arch_pkg_install/molecule/default/converge.yml
Normal file
7
roles/arch_pkg_install/molecule/default/converge.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include arch_pkg_install"
|
||||
include_role:
|
||||
name: "arch_pkg_install"
|
||||
11
roles/arch_pkg_install/molecule/default/molecule.yml
Normal file
11
roles/arch_pkg_install/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
|
||||
Binary file not shown.
Binary file not shown.
22
roles/arch_pkg_install/molecule/default/tests/conftest.py
Normal file
22
roles/arch_pkg_install/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
|
||||
)
|
||||
@@ -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"
|
||||
14
roles/arch_pkg_install/tasks/main.yml
Normal file
14
roles/arch_pkg_install/tasks/main.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
# 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
|
||||
2
roles/arch_pkg_install/tests/inventory
Normal file
2
roles/arch_pkg_install/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/arch_pkg_install/tests/test.yml
Normal file
5
roles/arch_pkg_install/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- arch_pkg_install
|
||||
2
roles/arch_pkg_install/vars/main.yml
Normal file
2
roles/arch_pkg_install/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for arch_pkg_install
|
||||
33
roles/dotfiles/.yamllint
Normal file
33
roles/dotfiles/.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
|
||||
7
roles/dotfiles/defaults/main.yml
Normal file
7
roles/dotfiles/defaults/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
user:
|
||||
username: 'vagrant'
|
||||
|
||||
dotusers: ["{{ user }}"]
|
||||
|
||||
config2stow: ["nvim", "tmux", "zsh"]
|
||||
33
roles/dotfiles/molecule/.yamllint
Normal file
33
roles/dotfiles/molecule/.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
|
||||
23
roles/dotfiles/molecule/default/INSTALL.rst
Normal file
23
roles/dotfiles/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/dotfiles/molecule/default/converge.yml
Normal file
7
roles/dotfiles/molecule/default/converge.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include dotfiles"
|
||||
include_role:
|
||||
name: "dotfiles"
|
||||
14
roles/dotfiles/molecule/default/molecule.yml
Normal file
14
roles/dotfiles/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: vagrant
|
||||
platforms:
|
||||
- name: archlinux
|
||||
box: "archlinux/archlinux"
|
||||
- name: Debian
|
||||
box: "debian/bullseye64"
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
name: testinfra
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22
roles/dotfiles/molecule/default/tests/conftest.py
Normal file
22
roles/dotfiles/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
|
||||
)
|
||||
23
roles/dotfiles/molecule/default/tests/test_default.py
Normal file
23
roles/dotfiles/molecule/default/tests/test_default.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Role testing files using testinfra."""
|
||||
|
||||
|
||||
def test_stow_installed(host):
|
||||
stow = host.package("stow")
|
||||
assert stow.is_installed
|
||||
|
||||
def test_dotfile_cloned(host):
|
||||
homepath = host.run("pwd").stdout[:-1]
|
||||
dotfiles = host.file(homepath + "/.dotfiles")
|
||||
assert dotfiles.exists
|
||||
|
||||
def test_dotfile_stowed(host):
|
||||
homepath = host.run("pwd").stdout[:-1]
|
||||
nvim = host.file(homepath + "/.config/nvim/")
|
||||
assert nvim.exists
|
||||
tmux = host.file(homepath + "/.tmux/")
|
||||
assert tmux.exists
|
||||
zshenv = host.file(homepath + "/.zshenv")
|
||||
assert zshenv.exists
|
||||
zsh = host.file(homepath + "/.config/zsh/")
|
||||
assert zsh.exists
|
||||
|
||||
14
roles/dotfiles/tasks/arch.yml
Normal file
14
roles/dotfiles/tasks/arch.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Install stow
|
||||
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
|
||||
14
roles/dotfiles/tasks/debian.yml
Normal file
14
roles/dotfiles/tasks/debian.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Install stow
|
||||
apt:
|
||||
name: stow
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
|
||||
- name: Install git
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
20
roles/dotfiles/tasks/main.yml
Normal file
20
roles/dotfiles/tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Install for arch
|
||||
import_tasks: arch.yml
|
||||
when: ansible_os_family == "Archlinux"
|
||||
|
||||
- name: Install for debian
|
||||
import_tasks: debian.yml
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Clone dotfiles
|
||||
ansible.builtin.git:
|
||||
repo: 'https://git.opytex.org/lafrite/dotfiles.git'
|
||||
dest: /home/{{ item.username }}/.dotfiles
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
- name: stow configs
|
||||
ansible.builtin.command:
|
||||
cmd: stow {{ item }}
|
||||
chdir: ~/.dotfiles/
|
||||
with_items: "{{ config2stow }}"
|
||||
29
roles/gnome/.travis.yml
Normal file
29
roles/gnome/.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/gnome/.yamllint
Normal file
33
roles/gnome/.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/gnome/README.md
Normal file
38
roles/gnome/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).
|
||||
4
roles/gnome/defaults/main.yml
Normal file
4
roles/gnome/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
# defaults file for gnome
|
||||
me:
|
||||
username: user1
|
||||
2
roles/gnome/handlers/main.yml
Normal file
2
roles/gnome/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for gnome
|
||||
23
roles/gnome/molecule/default/INSTALL.rst
Normal file
23
roles/gnome/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/gnome/molecule/default/converge.yml
Normal file
7
roles/gnome/molecule/default/converge.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include gnome"
|
||||
include_role:
|
||||
name: "gnome"
|
||||
11
roles/gnome/molecule/default/molecule.yml
Normal file
11
roles/gnome/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
|
||||
Binary file not shown.
Binary file not shown.
22
roles/gnome/molecule/default/tests/conftest.py
Normal file
22
roles/gnome/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/gnome/molecule/default/tests/test_default.py
Normal file
10
roles/gnome/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"
|
||||
53
roles/gnome/tasks/arch.yml
Normal file
53
roles/gnome/tasks/arch.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
# 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
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Install look and feel
|
||||
pacman:
|
||||
name:
|
||||
- materia-gtk-theme
|
||||
- gnome-icon-theme-extras
|
||||
- arc-solid-gtk-theme
|
||||
- arc-gtk-theme
|
||||
- gnome-themes-extra
|
||||
- gnome-icon-theme-symbolic
|
||||
- gnome-icon-theme
|
||||
- adwaita-icon-theme
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Install AUR Icons and gtk themes
|
||||
aur:
|
||||
name: "{{ item }}"
|
||||
use: makepkg
|
||||
state: present
|
||||
with_items:
|
||||
- plata-theme
|
||||
- gnome-colors-icon-theme
|
||||
- numix-icon-theme-git
|
||||
- numix-circle-icon-theme-git
|
||||
- tela-icon-theme-git
|
||||
become: yes
|
||||
become_user: aur_builder
|
||||
|
||||
81
roles/gnome/tasks/main.yml
Normal file
81
roles/gnome/tasks/main.yml
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
# tasks file for gnome
|
||||
- name: Install gnome for arch
|
||||
import_tasks: arch.yml
|
||||
when: ansible_os_family == "Archlinux"
|
||||
|
||||
|
||||
- name: enable service gdm
|
||||
systemd:
|
||||
name: gdm
|
||||
enabled: yes
|
||||
|
||||
- name: disable old network services
|
||||
systemd:
|
||||
name: '{{ item }}'
|
||||
enabled: no
|
||||
with_items:
|
||||
- dhcpcd
|
||||
ignore_errors: yes
|
||||
|
||||
- name: enable service NetworkManager
|
||||
systemd:
|
||||
name: NetworkManager
|
||||
enabled: yes
|
||||
|
||||
- name: <super + q> to close window
|
||||
dconf:
|
||||
key: "/org/gnome/desktop/wm/keybindings/close"
|
||||
value: "['<Super>q']"
|
||||
state: present
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- 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
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- 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
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- 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
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- name: Shell theme
|
||||
dconf:
|
||||
key: "/org/gnome/shell/extensions/user-theme/name"
|
||||
value: "'Materia-dark-compact'"
|
||||
state: present
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- name: Gtk theme
|
||||
dconf:
|
||||
key: "/org/gnome/desktop/interface/gkt-theme"
|
||||
value: "'Materia-dark-compact'"
|
||||
state: present
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
- name: Icon theme
|
||||
dconf:
|
||||
key: "/org/gnome/desktop/interface/icon-theme"
|
||||
value: "'Tela-orange-dark'"
|
||||
state: present
|
||||
become: true
|
||||
become_user: "{{ me.username }}"
|
||||
|
||||
2
roles/gnome/tests/inventory
Normal file
2
roles/gnome/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/gnome/tests/test.yml
Normal file
5
roles/gnome/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- gnome
|
||||
2
roles/gnome/vars/main.yml
Normal file
2
roles/gnome/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for gnome
|
||||
29
roles/mopidy-server/.travis.yml
Normal file
29
roles/mopidy-server/.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/mopidy-server/.yamllint
Normal file
33
roles/mopidy-server/.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/mopidy-server/README.md
Normal file
38
roles/mopidy-server/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).
|
||||
2
roles/mopidy-server/defaults/main.yml
Normal file
2
roles/mopidy-server/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for mopidy-server
|
||||
2
roles/mopidy-server/handlers/main.yml
Normal file
2
roles/mopidy-server/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for mopidy-server
|
||||
23
roles/mopidy-server/molecule/default/INSTALL.rst
Normal file
23
roles/mopidy-server/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/mopidy-server/molecule/default/converge.yml
Normal file
7
roles/mopidy-server/molecule/default/converge.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include mopidy-server"
|
||||
include_role:
|
||||
name: "mopidy-server"
|
||||
12
roles/mopidy-server/molecule/default/molecule.yml
Normal file
12
roles/mopidy-server/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: vagrant
|
||||
platforms:
|
||||
- name: Debian
|
||||
box: "debian/bullseye64"
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
name: testinfra
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22
roles/mopidy-server/molecule/default/tests/conftest.py
Normal file
22
roles/mopidy-server/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/mopidy-server/molecule/default/tests/test_default.py
Normal file
10
roles/mopidy-server/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"
|
||||
28
roles/mopidy-server/tasks/main.yml
Normal file
28
roles/mopidy-server/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
# tasks file for mopidy-server
|
||||
- name: install gpg
|
||||
apt:
|
||||
name: gpg
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
|
||||
|
||||
- name: Add an apt.modidy.com key
|
||||
ansible.builtin.apt_key:
|
||||
url: "https://apt.mopidy.com/mopidy.gpg"
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: Add apt.modidy.com repo
|
||||
get_url:
|
||||
url: https://apt.mopidy.com/buster.list
|
||||
dest: /etc/apt/sources.list.d/mopidy.list
|
||||
become: yes
|
||||
|
||||
- name: Install mopidy
|
||||
apt:
|
||||
name: mopidy
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
2
roles/mopidy-server/tests/inventory
Normal file
2
roles/mopidy-server/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/mopidy-server/tests/test.yml
Normal file
5
roles/mopidy-server/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- mopidy-server
|
||||
2
roles/mopidy-server/vars/main.yml
Normal file
2
roles/mopidy-server/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for mopidy-server
|
||||
33
roles/users/.yamllint
Normal file
33
roles/users/.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/users/README.md
Normal file
38
roles/users/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).
|
||||
21
roles/users/defaults/main.yml
Normal file
21
roles/users/defaults/main.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# defaults file for users
|
||||
user1:
|
||||
username: 'user1'
|
||||
password: 'user1'
|
||||
group: users
|
||||
groups:
|
||||
shell: '/bin/zsh'
|
||||
|
||||
user2:
|
||||
username: 'user2'
|
||||
password: 'user2'
|
||||
group: users
|
||||
groups: wheel
|
||||
system: yes
|
||||
|
||||
users: ["{{ user1 }}", "{{ user2 }}"]
|
||||
|
||||
public_key:
|
||||
- user: "{{ user1 }}"
|
||||
key: id_encrypt_fool.pub
|
||||
1
roles/users/files/id_encrypt_fool.pub
Normal file
1
roles/users/files/id_encrypt_fool.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdDO8452/DpTR8taSKa/i+rgAvrYP9Fv9hYLMuphHQ+ user1@fool
|
||||
2
roles/users/handlers/main.yml
Normal file
2
roles/users/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for users
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user