-
Notifications
You must be signed in to change notification settings - Fork 0
/
sclbuilder_600_create_mainpackage.yml
152 lines (129 loc) · 3.44 KB
/
sclbuilder_600_create_mainpackage.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
- name: Initial database seed
hosts: prod_awx
vars:
- organisation: "miracle"
- myrepo: "https://github.com/ansible/awx.git"
- project: "awxrpm"
- version: "19.4.0"
- scl_version: "19.4.0"
- scl_release: "1"
- scl_description: "Miracle supported awx"
tasks:
- name: Install rhel
ansible.builtin.package:
name:
- redis
- python38-pip
- python38-devel
- python3-devel
- python3-requests
- python38-requests
- wget
- rpm-build
- scl-utils-build
- scl-utils
- help2man
- unzip
- openssl-devel
- libtool-ltdl-devel
- python3-sphinx
- make
- gcc
- libffi-devel
- openldap-devel
- libxml2-devel
- xmlsec1-devel
- xmlsec1-openssl-devel
- libpq-devel
- platform-python-devel
- git
state: present
- name: Install bottle python package
pip:
name:
- requests
- requirements-parser
- spec2scl
- setuptools_rust
- wheel
- name: "generate SSH key {{ssh_key_filename}}"
openssh_keypair:
path: "~/.ssh/id_rsa"
type: rsa
size: 4096
state: present
force: no
become: True
- name: Store file into /tmp/fetched/host.example.com/tmp/somefile
ansible.builtin.fetch:
src: ~/.ssh/id_rsa.pub
dest: /var/lib/fetched
become: True
- name: create ssh config
ansible.builtin.template:
src: sshconfig.j2
dest: /root/.ssh/config
mode: 600
force: yes
become: True
- name: Install psyorg in the platforn python
command: /usr/libexec/platform-python -m pip install psycopg2-binary
become: True
- name: Add the user 'sclbuilder'
ansible.builtin.user:
name: sclbuilder
comment: service account for scl create
become: True
- name: Simple select query to acme db
postgresql_query:
db: sclbuilder
login_host: sclbuilder
login_user: "sclbuilder"
login_password: "django2know"
query: SELECT version()
become: yes
become_user: sclbuilder
- name: create_specfiles | create a tailored script
ansible.builtin.template:
src: create.sclspec.sh.j2
dest: /usr/local/bin/create.sclspec.sh
mode: 755
force: yes
become: True
- name: Creates directory
file:
path: /root/rpmbuild/SOURCES
state: directory
become: True
- name: create_specfiles | create a tailored metaspecfile
ansible.builtin.template:
src: metascl.spec.j2
dest: /root/{{ organisation }}.{{ project }}.meta.scl.spec
mode: 644
force: yes
become: True
- name: create_specfiles | create a tailored metaspecfile for {{ project }}
ansible.builtin.template:
src: project.specfile.spec.j2
dest: /root/{{ organisation }}.{{ project }}.project.spec
mode: 644
force: yes
become: True
- name: create_specfiles | Touch /root/rpmbuild/SOURCES/LICENSE
shell: touch /root/rpmbuild/SOURCES/LICENSE
become: True
- name: create_specfiles | run the builder script
shell: /usr/local/bin/create.sclspec.sh
become: True
- name: Creates directory
file:
path: /root/checkout
state: absent
- name: Git checkout
ansible.builtin.git:
repo: "{{ myrepo }}"
dest: /root/checkout/
clone: yes
version: 19.4.0
become: True