Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
update molecule
Browse files Browse the repository at this point in the history
  • Loading branch information
bodsch committed Dec 6, 2023
1 parent 5dc05d3 commit bb683ed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
18 changes: 11 additions & 7 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,35 @@ lint: |
platforms:
- name: instance
image: "bodsch/ansible-${DISTRIBUTION:-debian:11}"
image: "bodsch/ansible-${DISTRIBUTION:-debian:12}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
docker_host: "${DOCKER_HOST:-unix://run/docker.sock}"
privileged: true
pre_build_image: true
cgroupns_mode: host
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/lib/containerd
#capabilities:
# - SYS_ADMIN
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
# needs only by ubuntu 20.04
# - /var/lib/docker/overlay2:/var/lib/docker/overlay2:rw

provisioner:
name: ansible
ansible_args:
- --diff
# - -v
- -v
config_options:
defaults:
deprecation_warnings: True
deprecation_warnings: true
stdout_callback: yaml
callbacks_enabled: profile_tasks
gathering: smart
fact_caching: jsonfile
fact_caching_timeout: 8640
fact_caching_connection: ansible_facts

scenario:
test_sequence:
Expand Down
24 changes: 17 additions & 7 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
---
- name: prepare container

- name: information
hosts: all
gather_facts: true

pre_tasks:
- name: arch- / artixlinux
when:
- ansible_distribution | lower == 'archlinux' or
ansible_os_family | lower == 'artix linux'
block:
- name: update pacman system
command: |
ansible.builtin.command: |
pacman --refresh --sync --sysupgrade --noconfirm
- name: create depends service
copy:
ansible.builtin.copy:
mode: 0755
dest: /etc/init.d/net
content: |
Expand All @@ -20,17 +24,23 @@
when:
- ansible_os_family | lower == 'artix linux'

when:
- ansible_distribution | lower == 'archlinux' or
ansible_os_family | lower == 'artix linux'
- name: update package cache
become: true
ansible.builtin.package:
update_cache: true

- debug:
- name: environment
ansible.builtin.debug:
msg:
- "os family : {{ ansible_distribution }} ({{ ansible_os_family }})"
- "distribution version : {{ ansible_distribution_major_version }}"
- "ansible version : {{ ansible_version.full }}"
- "python version : {{ ansible_python.version.major }}.{{ ansible_python.version.minor }}"

- name: prepare container
hosts: all
gather_facts: true

roles:
- role: syslog-ng
- role: knot

0 comments on commit bb683ed

Please sign in to comment.