Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable molecule tests #316

Merged
merged 15 commits into from
Dec 3, 2022
51 changes: 27 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,34 @@ jobs:
yamllint .
ansible-lint

# molecule:
# name: Molecule
# runs-on: ubuntu-latest
molecule:
name: Molecule
runs-on: ubuntu-latest

strategy:
matrix:
distro:
- debian11
steps:
- name: Check out the repository
uses: actions/checkout@v3

# strategy:
# matrix:
# distro:
# - debian11
# steps:
# - name: Check out the repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.11"
- name: Upgrade pip
run: |
python3 -m pip install --constraint=.github/workflows/constraints.txt pip
python3 -m pip --version

# - name: Install test dependencies
# run: pip3 install ansible molecule[docker] docker
- name: Install test dependencies
run: pip3 install --constraint=.github/workflows/constraints.txt ansible molecule[docker] docker

# - name: Run Molecule tests
# run: molecule test
# env:
# PY_COLORS: "1"
# ANSIBLE_FORCE_COLOR: "1"
# MOLECULE_DISTRO: ${{ matrix.distro }}
- name: Run Molecule tests
run: molecule test
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}
36 changes: 17 additions & 19 deletions default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ golang_version: "1.19"
# Python settings
python_developer: true
pyenv_python_versions:
- 3.11.0
- 3.10.6
- 3.9.13
- 3.8.13
- 3.7.13
- 3.9.15
- 3.8.15
pyenv_global:
- 3.11.0
- 3.10.6
- 3.9.13
- 3.8.13
- 3.7.13
- 3.9.15
- 3.8.15
pyenv_virtualenvs: []

# browser configs
Expand All @@ -56,7 +56,7 @@ firefox_profiles:
install_brave: true

# keyboard config
configure_keyboard: true
configure_keyboard: false
keyboard_layout: us
keyboard_variant: intl
keyboard_c_cedilla: false
Expand Down Expand Up @@ -114,13 +114,11 @@ remove_libreoffice: true
installed_packages:
- apache2-utils
- cmake
- containerd # container runtime
- dconf-editor # visual gnome configs
- gir1.2-clutter-1.0 # dep gnome extension system monitor
- gir1.2-clutter-gst-3.0 # dep gnome extension system monitor
- gir1.2-gtkclutter-1.0 # dep gnome extension system monitor
- git
- guake
- htop
- locales-all
- nmap
Expand All @@ -140,11 +138,11 @@ installed_packages:
install_extra_packages: true
# Note: You are responsible for making sure the required package managers are
# installed, eg. through homebrew.
snap_packages:
- name: kubectl
classic: true
- name: onlyoffice-desktopeditors
- name: postman
snap_packages: []
# - name: kubectl
# classic: true
# - name: onlyoffice-desktopeditors
# - name: postman
gem_packages: []
# - name: bundler
# state: present # present/absent/latest, default: present
Expand All @@ -159,7 +157,7 @@ pip_packages: []
# version: "0.16.3" # default: N/A

# Gnome config
gnome_setup: true
gnome_setup: false
gnome_favorite_apps:
[
"firefox-esr.desktop",
Expand All @@ -169,12 +167,12 @@ gnome_favorite_apps:
]

# enable entire screen sharing
enable_screen_sharing: true
enable_screen_sharing: false

# extra installs
## cryptomator
install_cryptomator: false
cryptomator_version: 1.6.13
cryptomator_version: 1.6.15

install_keypass_xc: false
install_obs: false
Expand All @@ -184,8 +182,8 @@ install_signal: false
## openrgb
install_openrgb: false
# get from https://gitlab.com/CalcProgrammer1/OpenRGB/-/tags
openrgb_git_release: release_0.7
openrgb_deb_version: 0.7.0
openrgb_git_release: release_0.8
openrgb_deb_version: 0.8.0
openrgb_deb_architecture: amd64

# glob pattern to ansible task files to run after all other tasks are finished.
Expand Down
8 changes: 8 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@
update_cache: true
cache_valid_time: 3600

- name: Install required packages
ansible.builtin.apt:
name:
- firefox-esr
- gpg
- python3-bcrypt
- python3-requests

- import_playbook: ../../main.yml
7 changes: 6 additions & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ lint: |
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian11}-ansible:latest"
cgroupns_mode: host
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
# USER needed to have ansible_env.USER in docker
# https://github.com/ansible-community/molecule-docker/discussions/192
env:
USER: root
provisioner:
name: ansible
verifier:
Expand Down
6 changes: 6 additions & 0 deletions tasks/ssh.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
- name: Create .ssh directory if it does not exist
ansible.builtin.file:
path: ~/.ssh
state: directory
mode: '0700'

- name: Generate an OpenSSH keypair
community.crypto.openssh_keypair:
path: "~/.ssh/id_{{ ssh_key_type }}"
Expand Down