fix(alpine): testing in molecule and rename service

This commit is contained in:
Xan Manning 2022-06-15 18:45:54 +01:00
parent 910b611058
commit 5f560137f4
6 changed files with 7 additions and 17 deletions

View file

@ -14,12 +14,12 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& python3 -m pip install pip --upgrade \ && python3 -m pip install pip --upgrade \
&& python3 -m pip install -r /tmp/molecule/requirements.txt && python3 -m pip install -r /tmp/molecule/requirements.txt
RUN useradd -m vscode && \ RUN useradd -s /bin/bash -m vscode && \
usermod -aG docker vscode && \ usermod -aG docker vscode && \
echo 'vscode ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/vscode && \ echo 'vscode ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/vscode && \
echo 'source /etc/bash_completion.d/git-prompt' >> /home/vscode/.bashrc && \ echo 'source /etc/bash_completion.d/git-prompt' >> /home/vscode/.bashrc && \
echo 'sudo chown vscode /var/run/docker-host.sock' >> /home/vscode/.bashrc && \ echo 'sudo chown vscode /var/run/docker-host.sock' >> /home/vscode/.bashrc && \
echo 'export PS1="${PS1}\[\033[38;5;196m\]$(__git_ps1)\[$(tput sgr0)\] "' >> /home/vscode/.bashrc echo 'export PS1="${PS1:0:-1}\[\033[38;5;196m\]$(__git_ps1)\[$(tput sgr0)\] "' >> /home/vscode/.bashrc
RUN ln -s /var/run/docker-host.sock /var/run/docker.sock RUN ln -s /var/run/docker-host.sock /var/run/docker.sock

View file

@ -42,7 +42,7 @@ jobs:
prebuilt: 'true' prebuilt: 'true'
- distro: geerlingguy/docker-fedora33-ansible:latest - distro: geerlingguy/docker-fedora33-ansible:latest
scenario: autodeploy scenario: autodeploy
- distro: nimmis/alpine:3.14 - distro: xanmanning/docker-alpine-ansible:3.16
scenario: highavailabilityetcd scenario: highavailabilityetcd
command: "init" command: "init"
prebuilt: 'false' prebuilt: 'false'

View file

@ -38,6 +38,9 @@ galaxy_info:
# platforms is a list of platforms, and each platform has a name and a list of versions. # platforms is a list of platforms, and each platform has a name and a list of versions.
# #
platforms: platforms:
- name: Alpine
versions:
- all
- name: Archlinux - name: Archlinux
versions: versions:
- all - all

View file

@ -61,21 +61,10 @@
become: "{{ k3s_become }}" become: "{{ k3s_become }}"
- name: Ensure secondary controllers are started - name: Ensure secondary controllers are started
ansible.builtin.systemd: include_tasks: ensure_control_plane_started_{{ ansible_service_mgr }}.yml
name: k3s
state: started
enabled: "{{ k3s_start_on_boot }}"
register: ensure_secondary_controllers_started
failed_when:
- ensure_secondary_controllers_started is not succeeded
- not ansible_check_mode
until: ensure_secondary_controllers_started is succeeded
retries: "{{ ansible_play_hosts | length }}"
delay: 5
when: when:
- k3s_control_node - k3s_control_node
- not k3s_primary_control_node - not k3s_primary_control_node
become: "{{ k3s_become }}"
- import_tasks: post_checks_control_plane.yml - import_tasks: post_checks_control_plane.yml
when: not k3s_skip_validation when: not k3s_skip_validation

View file

@ -18,7 +18,6 @@ k3s_valid_states:
# Supported init systems # Supported init systems
k3s_supported_init: k3s_supported_init:
- systemd - systemd
- sysvinit # Possibly what openrc identifies as in Ansible?
- openrc - openrc
# Map ansible fact gathering architecture to a release name and suffix in github. # Map ansible fact gathering architecture to a release name and suffix in github.
@ -99,7 +98,6 @@ k3s_logrotate_dir: /etc/logrotate.d
# Service handler # Service handler
k3s_service_handler: k3s_service_handler:
systemd: systemd systemd: systemd
sysvinit: service
openrc: service openrc: service
# Data directory location for k3s # Data directory location for k3s