Commit 9cca6c4b authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: implement new role layout

parent e8489b96
Loading
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2,19 +2,14 @@

# gitLab ci stages
stages:

  # deployment
  - "gitleaks"
  - "linting"
  - "deployment"


# include jobs
include:

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

  # linting
  - component: "$CI_SERVER_FQDN/components/ansible/linting@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"
+2 −1
Original line number Diff line number Diff line
@@ -5,4 +5,5 @@ galaxy_info:
  description: "install and configure a Zabbix Proxy"
  license: "MIT"
  role_name: "zabbix_proxy"
dependencies: []
dependencies:
  - "zabbix_prereq"
+4 −3
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
      changed_when: false
      failed_when: false

  roles:
    - role: "zabbix_prereq"
    - role: "zabbix_proxy"
    # execute the role
    - name: "execute role: zabbix_proxy"
      ansible.builtin.include_role:
        name: "zabbix_proxy"
+0 −0

File moved.