summaryrefslogtreecommitdiffstats
path: root/roles/bodhi2/base/tasks/main.yml
blob: 7e6c859452171d2cd1ceee7be76f628ac87162a5 (plain)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
---
# tasklist for setting up bodhi
# This is the base set of files needed for bodhi

- name: install needed packages
  package: pkg={{ item }} state=present
  with_items:
  - bodhi-server
  - libsemanage-python
  - python-psycopg2
  tags:
  - packages
  - bodhi

- name: install documentation package
  package: pkg=bodhi-docs state=present
  when: env == 'staging'
  tags:
  - packages
  - bodhi

- name: setup /etc/bodhi/ directory
  file: path=/etc/bodhi owner=root group=root mode=0755 state=directory
  tags:
  - config
  - bodhi

- name: setup basic /etc/bodhi/ contents (staging)
  template: >
    src="staging.ini.j2"
    dest="/etc/bodhi/production.ini"
    owner=bodhi
    group=bodhi
    mode=0600
  when: inventory_hostname.startswith('bodhi0') and env == 'staging'
  notify:
  - reload bodhi httpd
  tags:
  - config
  - bodhi

- name: setup basic /etc/bodhi/ contents (production)
  template: >
    src="production.ini.j2"
    dest="/etc/bodhi/production.ini"
    owner=bodhi
    group=bodhi
    mode=0600
  when: inventory_hostname.startswith('bodhi0') and env == 'production'
  notify:
  - reload bodhi httpd
  tags:
  - config
  - bodhi

- name: Copy some fedmsg configuration of our own for fedmsg-hub
  template: >
      src={{item}}
      dest=/etc/fedmsg.d/{{item}}
      owner=root
      group=root
      mode=0644
  with_items:
  - bodhi-logging.py
  - bodhi-threading.py
  - bodhi.py
  - masher.py
  - updates_handler.py
  - signed_handler.py
  notify:
  - restart fedmsg-hub
  tags:
  - config
  - bodhi

- name: setup basic /etc/httpd/conf.d/ bodhi contents
  template: >
    src="bodhi-app.conf"
    dest="/etc/httpd/conf.d/bodhi.conf"
    owner=root
    group=root
    mode=0644
  when: inventory_hostname.startswith('bodhi0')
  notify:
  - reload bodhi httpd
  tags:
  - config
  - bodhi

- name: setup /etc/pki/bodhi directory
  file: path=/etc/pki/bodhi owner=root group=root mode=0755 state=directory
  tags:
  - config
  - bodhi

- name: setup /var/cache/bodhi directory
  file: dest=/var/cache/bodhi mode=0755 state=directory
  tags:
  - config
  - bodhi

- name: Create ccache directory
  file: dest=/var/run/bodhi.ccache mode=0700 state=directory
        owner=apache group=apache
  tags:
  - config
  - bodhi

#- name: setup /var/log/bodhi directory
#  file: path=/var/log/bodhi owner=bodhi group=bodhi mode=0755 state=directory
#  when: inventory_hostname.startswith('bodhi0')
#  tags:
#  - config
#  - bodhi

#- name: check the selinux context of the bugzilla cookie
#  command: matchpathcon /var/tmp/bodhi-bz.cookie
#  register: cookiecontext
#  check_mode: no
#  changed_when: "1 != 1"
#  tags:
#  - config
#  - bodhi
#  - selinux
#
#- name: set the SELinux policy for the bugzilla cookie
#  command: semanage fcontext -a -t httpd_tmp_t "/var/tmp/bodhi-bz.cookie"
#  when: cookiecontext.stdout.find('httpd_tmp_t') == -1
#  tags:
#  - config
#  - bodhi
#  - selinux

- name: enable httpd_tmp_exec SELinux boolean
  seboolean: name=httpd_tmp_exec state=yes persistent=yes
  tags:
  - config
  - bodhi
  - selinux

- name: enable httpd_can_network_connect_db SELinux boolean
  seboolean: name=httpd_can_network_connect_db state=yes persistent=yes
  tags:
  - config
  - bodhi
  - selinux

- name: enable httpd_can_network_connect SELinux boolean
  seboolean: name=httpd_can_network_connect state=yes persistent=yes
  tags:
  - config
  - bodhi
  - selinux

- name: enable httpd_execmem SELinux boolean
  seboolean: name=httpd_execmem state=yes persistent=yes
  tags:
  - config
  - bodhi
  - selinux

- name: check the selinux context of bodhi's homedir
  command: matchpathcon /usr/share/bodhi/.fedora
  register: homedir
  check_mode: no
  changed_when: "1 != 1"
  tags:
  - config
  - bodhi
  - selinux

- name: /usr/share/bodhi/.fedora file contexts
  command: semanage fcontext -a -t httpd_sys_rw_content_t "/usr/share/bodhi/.fedora"
  when: homedir.stdout.find('httpd_sys_content_t') == -1
  tags:
  - config
  - bodhi
  - selinux