test with molecule
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
vincent 2022-10-09 19:43:15 +02:00
parent d38494d67e
commit 35e5b08949
10 changed files with 78 additions and 7 deletions

2
.ansible-lint Normal file
View File

@ -0,0 +1,2 @@
skip_list:
- 'fcqn-builtins'

View File

@ -39,7 +39,7 @@ hosts_file_snippets: []
system_ipV6_disable: true system_ipV6_disable: true
system_ssh_custom_host: system_ssh_custom_host: []
# - host: # - host:
# user: # user:
# keyfile: # keyfile:

View File

@ -1,6 +1,7 @@
--- ---
galaxy_info: galaxy_info:
author: VincentDcmps author: VincentDcmps
namespace: vincentdcmps
description: description:
company: company:

View File

@ -0,0 +1,8 @@
---
- name: Converge
remote_user: vagrant
hosts: all
tasks:
- name: "Include vincentdcmps.test"
include_role:
name: "vincentdcmps.system"

View File

@ -0,0 +1,36 @@
---
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: libvirt
options:
memory: 512
cpus: 2
platforms:
- name: archlinux
box: archlinux/archlinux
# - name: rocky8
#box: generic/rocky8
- name: rocky9
box: generic/rocky9
provisioner:
name: ansible
connection_options:
ansible_ssh_user: vagrant
ansible_become: true
log: true
lint:
name: ansible-lint
inventory:
host_vars:
archlinux:
user:
name: vagrant
rocky9:
user:
name: vagrant
verifier:
name: ansible

View File

@ -0,0 +1,12 @@
- hosts: archlinux
remote_user: vagrant
become: true
gather_facts: true
tasks:
- name: Init pacman
ansible.builtin.raw: |
pacman-key --init
pacman-key --populate archlinux
changed_when: false
failed_when: false

View File

@ -0,0 +1,10 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true

View File

@ -7,5 +7,5 @@
become: true become: true
register: service_stop register: service_stop
failed_when: failed_when:
- '"Could not find the requested service" not in service_stop.msg' # - '"Could not find the requested service" not in service_stop.msg'
- service_stop.rc != 0 - service_stop.rc is defined and service_stop.rc != 0

View File

@ -20,7 +20,7 @@
line: "Server= {{ system_arch_local_mirror }}/repo/archlinux_$arch/$repo/os/$arch" line: "Server= {{ system_arch_local_mirror }}/repo/archlinux_$arch/$repo/os/$arch"
state: present state: present
insertbefore: BOF insertbefore: BOF
when: system_arch_local_mirror is defined when: system_arch_local_mirror
- name: stat ca-certificates - name: stat ca-certificates
stat: stat:

View File

@ -1,9 +1,11 @@
--- ---
- name: Enable timesync - name: Enable timesync
command: timedatectl set-ntp true service:
name: systemd-timesyncd.service
enabled: true
state: started
become: true become: true
args: when: ansible_facts['os_family'] == 'Archlinux'
creates: /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
- name: Set timezone and hardware clock - name: Set timezone and hardware clock
timezone: timezone: