initial commit

This commit is contained in:
Phil
2019-09-20 15:08:16 -04:00
commit e42131e407
29 changed files with 1761 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# Molecule managed
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
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[docker]'

View File

@ -0,0 +1,38 @@
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: ansible-role-oh-my-zsh-debian-min
image: debian:8
- name: ansible-role-oh-my-zsh-debian-max
image: debian:9
- name: ansible-role-oh-my-zsh-ubuntu-min
image: ubuntu:14.04
- name: ansible-role-oh-my-zsh-ubuntu-max
image: ubuntu:18.04
- name: ansible-role-oh-my-zsh-centos
image: centos:7
- name: ansible-role-oh-my-zsh-fedora
image: fedora:28
- name: ansible-role-oh-my-zsh-opensuse
image: opensuse/leap:15.0
provisioner:
name: ansible
lint:
name: ansible-lint
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8

View File

@ -0,0 +1,39 @@
---
- name: Converge
hosts: all
pre_tasks:
- name: create test users
become: yes
user:
name: '{{ item }}'
home: '/home/{{ item }}'
createhome: yes
with_items:
- test_usr1
- test_usr2
- name: install console-setup file
become: yes
copy:
src: tests/console-setup.sh
dest: /etc/default/console-setup
force: no
owner: root
group: root
mode: 'u=rwx,go=r'
roles:
- role: ansible-role-oh-my-zsh
oh_my_zsh_theme: test_theme1
oh_my_zsh_plugins:
- test_plugin1
- test_plugin2
users:
- username: test_usr1
- username: test_usr2
oh_my_zsh:
theme: test_theme2
plugins:
- test_plugin3
- test_plugin4

View File

@ -0,0 +1,16 @@
# CONFIGURATION FILE FOR SETUPCON
# Consult the console-setup(5) manual page.
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="ISO-8859-1"
CODESET="Lat15"
FONTFACE="VGA"
FONTSIZE="8x16"
VIDEOMODE=
# The following is an example how to use a braille font
# FONT='lat9w-08.psf.gz brl-8x8.psf'

View File

@ -0,0 +1,45 @@
import pytest
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('username', [
'test_usr1',
'test_usr2',
])
def test_oh_my_zsh_install(host, username):
oh_my_zsh = host.file('/home/' + username + '/.oh-my-zsh')
assert oh_my_zsh.exists
assert oh_my_zsh.is_directory
assert oh_my_zsh.user == username
assert oh_my_zsh.group in [username, 'users']
@pytest.mark.parametrize('username,theme,plugins', [
('test_usr1', 'test_theme1', 'test_plugin1 test_plugin2'),
('test_usr2', 'test_theme2', 'test_plugin3 test_plugin4'),
])
def test_oh_my_zsh_config(host, username, theme, plugins):
zshrc = host.file('/home/' + username + '/.zshrc')
assert zshrc.exists
assert zshrc.is_file
assert zshrc.user == username
assert zshrc.group in [username, 'users']
assert zshrc.contains(theme)
assert zshrc.contains(plugins)
def test_console_setup(host):
# console-setup is Debian family specific
if host.file('/etc/debian_version').exists:
setup = host.file('/etc/default/console-setup')
assert setup.exists
assert setup.is_file
assert setup.user == 'root'
assert setup.group == 'root'
assert setup.contains('CHARMAP="UTF-8"')