Add nodepool_task_manager to expose control of tasks

There might be a time were we only want run the pre task, so rather
then copying the code into another modules, just allow the user to
override the task list that runs.

Change-Id: I15f58454607c5c56f9bb092036a656618b6b3c20
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-09-03 22:02:09 -04:00
parent bfe2244040
commit 7d719fe355
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
6 changed files with 21 additions and 9 deletions

View File

@ -12,6 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
---
# tasks/main.yaml
nodepool_task_manager:
- pre
- install
- config
- service
# tasks/config.yaml
nodepool_user_name: nodepool
nodepool_user_group: nodepool

View File

@ -18,6 +18,7 @@
when: nodepool_build_depends is not defined
- name: Ensure build dependencies are installed
become: yes
package:
name: "{{ item }}"
state: installed

View File

@ -13,12 +13,14 @@
# under the License.
---
- name: Git clone nodepool.
become: yes
git:
dest: "{{ nodepool_git_dest }}"
repo: "{{ nodepool_git_uri }}"
version: "{{ nodepool_git_version }}"
- name: Pip install nodepool from local git repo.
become: yes
pip:
extra_args: "{{ nodepool_pip_extra_args|default(omit) }}"
name: "file://{{ nodepool_git_dest }}"

View File

@ -13,6 +13,7 @@
# under the License.
---
- name: Install nodepool using pip.
become: yes
pip:
extra_args: "{{ nodepool_pip_extra_args|default(omit) }}"
name: "{{ nodepool_pip_name }}"

View File

@ -15,12 +15,7 @@
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yaml"
- include: pre.yaml
- include: install.yaml
become: yes
- include: config.yaml
- include: service.yaml
become: yes
- include: "{{ nodepool_task }}.yaml"
with_items: "{{ nodepool_task_manager }}"
loop_control:
loop_var: nodepool_task

View File

@ -73,6 +73,7 @@
when: nodepool_file_nodepool_builder_service_config_src is not defined
- name: Copy nodepool services scripts into place.
become: yes
copy:
dest: "{{ nodepool_file_nodepool_service_dest }}"
group: "{{ nodepool_file_nodepool_service_group }}"
@ -81,6 +82,7 @@
src: "{{ nodepool_file_nodepool_service_src }}"
- name: Copy nodepool service config into place.
become: yes
copy:
dest: "{{ nodepool_file_nodepool_service_config_dest }}"
group: "{{ nodepool_file_nodepool_service_config_group }}"
@ -89,6 +91,7 @@
src: "{{ nodepool_file_nodepool_service_config_src }}"
- name: Copy nodepool-builder services scripts into place.
become: yes
copy:
dest: "{{ nodepool_file_nodepool_builder_service_dest }}"
group: "{{ nodepool_file_nodepool_builder_service_group }}"
@ -97,6 +100,7 @@
src: "{{ nodepool_file_nodepool_builder_service_src }}"
- name: Copy nodepool service config into place.
become: yes
copy:
dest: "{{ nodepool_file_nodepool_builder_service_config_dest }}"
group: "{{ nodepool_file_nodepool_builder_service_config_group }}"
@ -105,6 +109,7 @@
src: "{{ nodepool_file_nodepool_builder_service_config_src }}"
- name: Enable nodepool service.
become: yes
service:
enabled: "{{ nodepool_service_nodepool_enabled }}"
name: "{{ nodepool_service_nodepool_name }}"
@ -112,6 +117,7 @@
when: nodepool_service_nodepool_manage
- name: Enable nodepool-builder service.
become: yes
service:
enabled: "{{ nodepool_service_nodepool_builder_enabled }}"
name: "{{ nodepool_service_nodepool_builder_name }}"