Skip to content
Extraits de code Groupes Projets
Valider 1357b199 rédigé par Fanch's avatar Fanch
Parcourir les fichiers

make molecule work

parent 748e9feb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
ENV container docker
RUN pacman -Syu --noconfirm
RUN pacman -S systemd python --noconfirm
#RUN systemctl set-default multi-user.target
VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]
STOPSIGNAL SIGRTMIN+3
RUN sleep 360
# ENTRYPOINT ["/usr/lib/systemd/systemd", "--log-level=info", "--unit=sysinit.target"]
# CMD ["/sbin/init"]
CMD ["/usr/lib/systemd/systemd", "--log-level=info", "--unit=sysinit.target"]
\ No newline at end of file
---
- name: Create
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
tasks:
# TODO: Developer must implement and populate 'server' variable
- when: server.changed | default(false) | bool
block:
- name: Populate instance config dict
set_fact:
instance_conf_dict: {
'instance': "{{ }}",
'address': "{{ }}",
'user': "{{ }}",
'port': "{{ }}",
'identity_file': "{{ }}", }
with_items: "{{ server.results }}"
register: instance_config_dict
- name: Convert instance config dict to a list
set_fact:
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
- name: Dump instance config
copy:
content: |
# Molecule managed
{{ instance_conf | to_json | from_json | to_yaml }}
dest: "{{ molecule_instance_config }}"
---
- name: Destroy
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
tasks:
# Developer must implement.
# Mandatory configuration for Molecule to function.
- name: Populate instance config
set_fact:
instance_conf: {}
- name: Dump instance config
copy:
content: |
# Molecule managed
{{ instance_conf | to_json | from_json | to_yaml }}
dest: "{{ molecule_instance_config }}"
when: server.changed | default(false) | bool
......@@ -2,9 +2,16 @@
dependency:
name: galaxy
driver:
name: delegated
name: docker
platforms:
- name: instance
- name: archlinux
image: archlinux/archlinux:base-devel
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
tmpfs:
- /tmp
- /run
provisioner:
name: ansible
verifier:
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter