# Copyright 2018 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. --- - name: Define gear_file_gear_service_dest. set_fact: gear_file_gear_service_dest: "{{ __gear_file_gear_service_dest }}" when: gear_file_gear_dest is not defined - name: Define gear_file_gear_service_mode. set_fact: gear_file_gear_service_mode: "{{ __gear_file_gear_service_mode }}" when: gear_file_gear_service_mode is not defined - name: Define gear_file_gear_service_src. set_fact: gear_file_gear_service_src: "{{ __gear_file_gear_service_src }}" when: gear_file_gear_service_src is not defined - name: Define gear_file_gear_service_config_dest. set_fact: gear_file_gear_service_config_dest: "{{ __gear_file_gear_service_config_dest }}" when: gear_file_gear_service_config_dest is not defined - name: Define gear_file_gear_service_config_mode. set_fact: gear_file_gear_service_config_mode: "{{ __gear_file_gear_service_config_mode }}" when: gear_file_gear_service_config_mode is not defined - name: Define gear_file_gear_service_config_src. set_fact: gear_file_gear_service_config_src: "{{ __gear_file_gear_service_config_src }}" when: gear_file_gear_service_config_src is not defined - name: Install gear service script into place. become: yes template: dest: "{{ gear_file_gear_service_dest }}" group: "{{ gear_file_gear_service_group }}" mode: "{{ gear_file_gear_service_mode }}" owner: "{{ gear_file_gear_service_owner }}" src: "{{ gear_file_gear_service_src }}" register: gear_file_gear_service when: gear_file_gear_service_manage - name: Create gear service config directory. become: yes file: group: "{{ gear_file_gear_service_config_group }}" owner: "{{ gear_file_gear_service_config_owner }}" path: "{{ gear_file_gear_service_dest }}.d" state: directory when: gear_file_gear_service_config_manage - name: Install gear service config into place. become: yes template: dest: "{{ gear_file_gear_service_config_dest }}" group: "{{ gear_file_gear_service_config_group }}" mode: "{{ gear_file_gear_service_config_mode }}" owner: "{{ gear_file_gear_service_config_owner }}" src: "{{ gear_file_gear_service_config_src }}" register: gear_file_gear_service_config when: gear_file_gear_service_config_manage - name: Enable gear service. become: yes systemd: daemon_reload: "{{ gear_service_gear_daemon_reload }}" enabled: "{{ gear_service_gear_enabled }}" name: "{{ gear_service_gear_name }}" state: "{{ gear_service_gear_state }}" register: gear_service_gear when: gear_service_gear_manage