From 218f3f7600d5593a0561b2112279cfc77b47be6a Mon Sep 17 00:00:00 2001 From: Dominika Hodovska Date: May 22 2018 15:24:04 +0000 Subject: Add task for enabling services --- diff --git a/roles/standard-test-basic/README.md b/roles/standard-test-basic/README.md index ec1de4a..9151c0a 100644 --- a/roles/standard-test-basic/README.md +++ b/roles/standard-test-basic/README.md @@ -15,5 +15,7 @@ to run testing. You can redefine the following variables in using the `rpm-ostree` command which is affecting the test subject (it's similar as rebuilding an rpm package to be tested) so this should be used with caution and only when necessary. + * **required_services**: A list of services to be started before running tests. + Please use `required_packages` for specifying packages that provide the services. Check `glib2` package tests to find examples for using this role. diff --git a/roles/str-common-init/tasks/main.yml b/roles/str-common-init/tasks/main.yml index 8b88da4..fa072f3 100644 --- a/roles/str-common-init/tasks/main.yml +++ b/roles/str-common-init/tasks/main.yml @@ -31,3 +31,10 @@ src: "{{ playbook_dir }}/" dest: "{{ tenv_workdir }}" ssh_args: "-o UserKnownHostsFile=/dev/null" + +- name: Start services defined in `required_services` + service: + name: "{{ item }}" + state: started + with_flattened: + - "{{ required_services|d|list|flatten }}"