Browse Source

[feature/add_prefix_name_support] - Add prefix name support

This way it's possible to add docker- to all services created
tags/v1.0.1
drymer 1 year ago
parent
commit
8d967655b1
Signed by: drymer <drymer@autistici.org> GPG Key ID: A307D64D5DDFDAAD
3 changed files with 4 additions and 2 deletions
  1. 1
    0
      README.md
  2. 2
    1
      defaults/main.yml
  3. 1
    1
      tasks/main.yml

+ 1
- 0
README.md View File

@@ -22,6 +22,7 @@ Role Variables
22 22
   directory containing the Dockerfile
23 23
 * `git_repository_tag`: Version to use of the git repository.
24 24
 * `service_name`: Name of the systemd service.
25
+* `service_name_prefix`: Prefix to be added before the `service_name` when creating the systemd service.
25 26
 * `docker_registry`: Domain of the registry with write access.
26 27
 * `docker_registry_read`: Domain of the registry with read access.
27 28
 * `registry_user`: User used to authenticate with the registry.

+ 2
- 1
defaults/main.yml View File

@@ -4,10 +4,11 @@ git_repository_destination:
4 4
 git_repository_extra_path:
5 5
 git_repository_tag:
6 6
 service_name:
7
+ervice_name_prefix:
7 8
 docker_registry:
8 9
 docker_registry_url:
9 10
 docker_registry_read:
10 11
 registry_user:
11 12
 registry_password:
12
-docker_image_tag: "{{ git_repository_tag }}"
13 13
 docker_command:
14
+docker_image_tag: "{{ git_repository_tag }}"

+ 1
- 1
tasks/main.yml View File

@@ -174,7 +174,7 @@
174 174
   become: True
175 175
   template:
176 176
     src: systemd-service.template
177
-    dest: "/etc/systemd/system/{{ service_name }}.service"
177
+    dest: "/etc/systemd/system/{{ service_name_prefix }}{{ service_name }}.service"
178 178
     owner: root
179 179
     group: root
180 180
 

Loading…
Cancel
Save