From bc7343a1f30d1adc62342c6cfc5a4ac4aa0a16b7 Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Wed, 11 Aug 2021 21:31:40 +0200 Subject: [PATCH] added support for systemd management --- .drone.yml | 12 ++++++------ defaults/main.yml | 5 +++++ tasks/main.yml | 11 ++++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index 20b2509..232358e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -54,7 +54,7 @@ steps: image: lerentis/ansible:debian-7 commands: - ansible-playbook -i tests/inventory tests/test-playbook.yml --syntax-check - - ansible-playbook -i tests/inventory tests/test-playbook.yml + - ansible-playbook -i tests/inventory tests/test-playbook.yml -e "CI_RUN=true" depends_on: - "prepare_workspace" @@ -62,7 +62,7 @@ steps: image: lerentis/ansible:ubuntu-16.04 commands: - ansible-playbook -i tests/inventory tests/test-playbook.yml --syntax-check - - ansible-playbook -i tests/inventory tests/test-playbook.yml + - ansible-playbook -i tests/inventory tests/test-playbook.yml -e "CI_RUN=true" depends_on: - "prepare_workspace" @@ -70,7 +70,7 @@ steps: image: lerentis/ansible:ubuntu-18.04 commands: - ansible-playbook -i tests/inventory tests/test-playbook.yml --syntax-check - - ansible-playbook -i tests/inventory tests/test-playbook.yml + - ansible-playbook -i tests/inventory tests/test-playbook.yml -e "CI_RUN=true" depends_on: - "prepare_workspace" @@ -78,7 +78,7 @@ steps: image: lerentis/ansible:ubuntu-20.04 commands: - ansible-playbook -i tests/inventory tests/test-playbook.yml --syntax-check - - ansible-playbook -i tests/inventory tests/test-playbook.yml + - ansible-playbook -i tests/inventory tests/test-playbook.yml -e "CI_RUN=true" depends_on: - "prepare_workspace" @@ -116,7 +116,7 @@ steps: commands: - pacman -Sy python2 glibc --noconfirm - ansible-playbook -i tests/inventory tests/test-playbook.yml --syntax-check - - ansible-playbook -i tests/inventory tests/test-playbook.yml + - ansible-playbook -i tests/inventory tests/test-playbook.yml -e "CI_RUN=true" depends_on: - "prepare_workspace" @@ -153,7 +153,7 @@ steps: image: lerentis/ansible:centos-7 commands: - ansible-playbook -i tests/inventory tests/test-playbook.yml --syntax-check - - ansible-playbook -i tests/inventory tests/test-playbook.yml + - ansible-playbook -i tests/inventory tests/test-playbook.yml -e "CI_RUN=true" depends_on: - "prepare_workspace" diff --git a/defaults/main.yml b/defaults/main.yml index b5577c1..ad9dd9a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,3 +2,8 @@ install: true package_list: - "apt" + +stop_service_list: + - rpc-statd + - portmap + - rpcbind \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index d2e901a..acc2270 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,4 +15,13 @@ - include_tasks: update-Arch.yml when: - - ansible_os_family == 'Archlinux' \ No newline at end of file + - ansible_os_family == 'Archlinux' + +- name: stop services + become: yes + systemd: + name: "{{ item }}" + state: stopped + enabled: no + with_items: stop_service_list + when: "CI_RUN != true"