Skip to content
Snippets Groups Projects
Commit 3b7b2ed5 authored by fejao's avatar fejao
Browse files

Setting ansible lint 03

parent 859e7a77
No related branches found
No related tags found
1 merge request!8Setting ansible lint 03
...@@ -15,6 +15,8 @@ variables: ...@@ -15,6 +15,8 @@ variables:
PLAYBOOK_NAME_FOR_ROLE_TEST: "playbook_example_01_test.yml" PLAYBOOK_NAME_FOR_ROLE_TEST: "playbook_example_01_test.yml"
PLAYBOOK_NAME_FOR_ROLE_DEPENDENCIES: "playbook_example_02_dependencies.yml" PLAYBOOK_NAME_FOR_ROLE_DEPENDENCIES: "playbook_example_02_dependencies.yml"
PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES: "playbook_example_03_clone_repositories.yml" PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES: "playbook_example_03_clone_repositories.yml"
PLAYBOOK_NAME_FOR_ROLE_DOCKER_IMAGES: "playbook_example_04_docker_images.yml"
PLAYBOOK_NAME_FOR_ROLE_DOCKER_CONTAINERS: "playbook_example_05_docker_containers.yml"
stages: stages:
- debug - debug
...@@ -75,3 +77,23 @@ role-clone-repositories: ...@@ -75,3 +77,23 @@ role-clone-repositories:
- echo "Running ansible-lint tests at the role-> 'clone_repositories'" - echo "Running ansible-lint tests at the role-> 'clone_repositories'"
- ansible-lint $PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES - ansible-lint $PLAYBOOK_NAME_FOR_ROLE_CLONE_REPOSITORIES
allow_failure: false allow_failure: false
role-docker-images:
stage: lint-tests
before_script:
- apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
- pip3 install -r requirements.txt
script:
- echo "Running ansible-lint tests at the role-> 'docker_images'"
- ansible-lint $PLAYBOOK_NAME_FOR_ROLE_DOCKER_IMAGES
allow_failure: false
role-docker-containers:
stage: lint-tests
before_script:
- apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
- pip3 install -r requirements.txt
script:
- echo "Running ansible-lint tests at the role-> 'docker_containers'"
- ansible-lint $PLAYBOOK_NAME_FOR_ROLE_DOCKER_CONTAINERS
allow_failure: false
--- ---
# Runs example for # Runs example for
- hosts: - name: Playbook for running the role 'docker_images'
hosts:
- example_servers_group - example_servers_group
roles: roles:
- docker_images - docker_images
--- ---
galaxy_info: galaxy_info:
role_name: docker-containers role_name: docker_containers
description: Role to work with the containers for the c3InfoDesk sytems description: Role to work with the containers for the c3InfoDesk sytems
author: fejao author: fejao
company: cccv.de company: cccv.de
......
...@@ -11,4 +11,3 @@ ...@@ -11,4 +11,3 @@
ansible.builtin.debug: ansible.builtin.debug:
var: ret_docker_compose_down var: ret_docker_compose_down
when: c3infodesk_printer_docker_compose_down_debug | bool when: c3infodesk_printer_docker_compose_down_debug | bool
...@@ -11,4 +11,3 @@ ...@@ -11,4 +11,3 @@
ansible.builtin.debug: ansible.builtin.debug:
var: ret_docker_compose_stop var: ret_docker_compose_stop
when: c3infodesk_printer_docker_compose_stop_debug | bool when: c3infodesk_printer_docker_compose_stop_debug | bool
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
when: when:
- cups_status is defined - cups_status is defined
- cups_status != 'masked' - cups_status != 'masked'
register: ret_stop_cups
changed_when: ret_stop_cups.rc != 0
- name: DISABLE CUPS | Disable the running CUPS on target - name: DISABLE CUPS | Disable the running CUPS on target
ansible.builtin.command: ansible.builtin.command:
...@@ -30,6 +32,8 @@ ...@@ -30,6 +32,8 @@
when: when:
- cups_status is defined - cups_status is defined
- cups_status != 'masked' - cups_status != 'masked'
register: ret_disable_cups
changed_when: ret_disable_cups.rc != 0
- name: DISABLE CUPS | Mask the running CUPS on target - name: DISABLE CUPS | Mask the running CUPS on target
ansible.builtin.command: ansible.builtin.command:
...@@ -39,3 +43,5 @@ ...@@ -39,3 +43,5 @@
when: when:
- cups_status is defined - cups_status is defined
- cups_status != 'masked' - cups_status != 'masked'
register: ret_mask_cups
changed_when: ret_mask_cups.rc != 0
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
chdir: "{{ c3infodesk_printer_folder }}" chdir: "{{ c3infodesk_printer_folder }}"
register: build_img_result register: build_img_result
when: result_check_image.images | length <= 0 when: result_check_image.images | length <= 0
changed_when: build_img_result.rc != 0
- name: APP | DEBUG -> Output from creating the docker image - name: APP | DEBUG -> Output from creating the docker image
ansible.builtin.debug: ansible.builtin.debug:
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
chdir: "{{ c3infodesk_printer_folder }}" chdir: "{{ c3infodesk_printer_folder }}"
register: build_img_result register: build_img_result
when: result_check_image.images | length <= 0 when: result_check_image.images | length <= 0
changed_when: build_img_result.rc != 0
- name: CUPS | DEBUG -> Output from creating the docker image - name: CUPS | DEBUG -> Output from creating the docker image
ansible.builtin.debug: ansible.builtin.debug:
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
chdir: "{{ c3infodesk_printer_folder }}" chdir: "{{ c3infodesk_printer_folder }}"
register: build_img_result register: build_img_result
when: result_check_image.images | length <= 0 when: result_check_image.images | length <= 0
changed_when: build_img_result.rc != 0
- name: PROXY | DEBUG -> Output from creating the docker image - name: PROXY | DEBUG -> Output from creating the docker image
ansible.builtin.debug: ansible.builtin.debug:
......
--- ---
# tasks file for docker-images # tasks file for docker-images
- import_tasks: docker_image_cups.yml - name: Create the docker image for cups
- import_tasks: docker_image_app.yml ansible.builtin.import_tasks: docker_image_cups.yml
- import_tasks: docker_image_proxy.yml
- name: Create the docker image for app
ansible.builtin.import_tasks: docker_image_app.yml
- name: Create the docker image for proxy
ansible.builtin.import_tasks: docker_image_proxy.yml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment