Commit e0d0d512 authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: depricated testing and deployment

parent 6994f1a1
Loading
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -6,21 +6,15 @@ stages:
  # deployment
  - "gitleaks"
  - "linting"
  - "testing"
  - "deployment"


# include jobs
include:

  # deployment
  - local: ".gitlab/deployment.yaml"
  - local: ".gitlab/gitleaks.yaml"

  # linting
  - component: "$CI_SERVER_FQDN/components/ansible/linting@v3.0.3"
  - component: "$CI_SERVER_FQDN/components/markdownlint/markdownlint@1.0.0"
  - component: "$CI_SERVER_FQDN/components/yamllint/yamllint@1.0.2"

  # testing
  - component: "$CI_SERVER_FQDN/components/ansible/testing@v3.0.3"

.gitlab/deployment.yaml

deleted100644 → 0
+0 −32
Original line number Diff line number Diff line
---
# deploy ansible/roles/common code
deployment:
  stage: "deployment"
  image:
    name: "registry.gitlab.simoncor.net/oci/ssh-client:v25.06.03"
    entrypoint: ["/bin/sh", "-c"]
  rules:

    # run only on push to default branch
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
    - when: "never"

  # prepare ssh
  before_script:

    # prepare ssh
    - |
        # prepare ssh
        mkdir -p ~/.ssh
        chmod 700 ~/.ssh
        echo "$SSH_CONFIG" > ~/.ssh/config
        echo "$SSH_DEPLOYMENT_KEY" > ~/.ssh/id_ed25519
        chmod 600 ~/.ssh/id_ed25519

  # deployment commands
  script:

    - |
        # install ansible roles dependancies
        ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER \
        "sudo /usr/local/bin/ansible-galaxy install -r /etc/ansible/roles/requirements.yaml --force"

molecule/default/converge.yml

deleted100644 → 0
+0 −9
Original line number Diff line number Diff line
---

# converge
- name: "converge"
  hosts: "all"
  become: true
  gather_facts: true
  roles:
    - role: "siempie.keepalived"

molecule/default/molecule.yml

deleted100644 → 0
+0 −42
Original line number Diff line number Diff line
---

dependency:
  name: "galaxy"

driver:
  name: "docker"

provisioner:
  name: "ansible"

verifier:
  name: "ansible"

platforms:

  # debian 12
  - name: "debian-12"
    image: "geerlingguy/docker-debian12-ansible:latest"
    pre_build_image: true
    privileged: true
    volumes:
      - "/sys/fs/cgroup:/sys/fs/cgroup:rw"
    command: "/lib/systemd/systemd"

  # ubuntu 22
  - name: "ubuntu-22"
    image: "geerlingguy/docker-ubuntu2204-ansible:latest"
    pre_build_image: true
    privileged: true
    volumes:
      - "/sys/fs/cgroup:/sys/fs/cgroup:rw"
    command: "/lib/systemd/systemd"

  # ubuntu 24
  - name: "ubuntu-24"
    image: "geerlingguy/docker-ubuntu2404-ansible:latest"
    pre_build_image: true
    privileged: true
    volumes:
      - "/sys/fs/cgroup:/sys/fs/cgroup:rw"
    command: "/lib/systemd/systemd"

molecule/default/verify.yml

deleted100644 → 0
+0 −20
Original line number Diff line number Diff line
---

# verify
- name: "verify"
  hosts: "all"
  become: true
  gather_facts: true
  tasks:

    # check if keepalived is installed
    - name: "check package"
      ansible.builtin.package:
        name: "keepalived"
        state: "present"

    # check if keepalived is started
    - name: "check service"
      ansible.builtin.service:
        name: "keepalived"
        state: "started"