-
Notifications
You must be signed in to change notification settings - Fork 0
/
sclbuilder_020_subproject.yml
44 lines (41 loc) · 1.1 KB
/
sclbuilder_020_subproject.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: Setup a project in prod_sclbuilder_worker
hosts: sclbuilder
vars:
organisation: "miracle"
project: "awxrpm"
version: "1.0.0"
description: "Miracle supported awx installed with software collections"
tasks:
- name: Check if it already exists
postgresql_query:
db: sclbuilder
login_user: "sclbuilder"
login_password: "django2know"
query: select * from projects_subproject where subprojectprojectname = '{{ project }}';
register: myproject
become: yes
become_user: sclbuilder
- name: insert when missing
postgresql_query:
db: sclbuilder
login_user: "sclbuilder"
login_password: "django2know"
query: >-
INSERT INTO projects_project (
projectname,
projectversion,
projectstatus,
projectdescription,
projectcreated
)
VALUES (
'{{ project }}',
'{{ version }}',
'Initial',
'{{ description }}',
'{{ ansible_date_time.date }} '
);
register: insertproject
become: yes
become_user: sclbuilder