forked from infra/ansible
Compare commits
17 commits
ac57bbb2ea
...
4af6011bb8
| Author | SHA1 | Date | |
|---|---|---|---|
| 4af6011bb8 | |||
| b4ddcdd830 | |||
| 8fa05b2955 | |||
| 5b88ef525f | |||
| 488e9ae7e5 | |||
| 96d23293a2 | |||
| 08928917e6 | |||
| 4392472669 | |||
| 4d8a14db4e | |||
| b4ff5f819d | |||
| 7b4774117d | |||
| a7ce1173a6 | |||
| f601a5ce0b | |||
| ae70d6e83a | |||
| d619073a15 | |||
| 76e6ffd412 | |||
| 709f7a12c4 |
16 changed files with 82 additions and 209 deletions
|
|
@ -67,3 +67,4 @@ skip_list:
|
|||
- role-name[path]
|
||||
- var-naming[no-role-prefix]
|
||||
- no-changed-when
|
||||
- ignore-errors
|
||||
|
|
|
|||
|
|
@ -896,20 +896,6 @@
|
|||
keephost: true
|
||||
tags: discourse2fedmsg
|
||||
|
||||
# - role: httpd/reverseproxy
|
||||
# website: ipsilon-project.org
|
||||
# destname: ipsilon-website
|
||||
# balancer_name: apps-ocp
|
||||
# balancer_members: "{{ (env == 'staging')|ternary(ocp_nodes_rdu3_stg, ocp_nodes) }}"
|
||||
# targettype: openshift
|
||||
# ocp4: "{{ (env == 'production') | bool }}"
|
||||
# ocp4_rdu3: "{{ (env == 'staging') | bool }}"
|
||||
# # When prod has moved to rdu3:
|
||||
# #ocp4: false
|
||||
# #ocp4_rdu3: true
|
||||
# keephost: true
|
||||
# tags: ipsilon-website
|
||||
|
||||
- role: httpd/reverseproxy
|
||||
website: awx.fedoraproject.org
|
||||
destname: awx
|
||||
|
|
|
|||
|
|
@ -1210,18 +1210,6 @@
|
|||
tags:
|
||||
- fedora.im
|
||||
|
||||
# - role: httpd/website
|
||||
# site_name: ipsilon-project.org
|
||||
# cert_name: ipsilon-project.org
|
||||
# server_aliases:
|
||||
# - ipsilon-project.org
|
||||
# - www.ipsilon-project.org
|
||||
# ssl: true
|
||||
# sslonly: true
|
||||
# certbot: true
|
||||
# tags:
|
||||
# - ipsilon-website
|
||||
|
||||
- role: httpd/website
|
||||
site_name: directory.fedoraproject.org
|
||||
ssl: true
|
||||
|
|
|
|||
|
|
@ -18,3 +18,5 @@
|
|||
- gwmngilfen
|
||||
- nphilipp
|
||||
- zlopez
|
||||
cluster_readonly_appowners:
|
||||
- smoliicek
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
---
|
||||
- name: Make the app be real
|
||||
hosts: os_control_stg[0]:os_control[0]
|
||||
user: root
|
||||
gather_facts: false
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "/srv/private/ansible/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
vars:
|
||||
|
||||
roles:
|
||||
- role: openshift/project
|
||||
project_app: ipsilon-website
|
||||
project_description: "ipsilon-project.org"
|
||||
project_appowners:
|
||||
- abompard
|
||||
tags:
|
||||
- apply-appowners
|
||||
|
||||
- role: openshift/imagestream
|
||||
imagestream_app: ipsilon-website
|
||||
imagestream_imagename: ipsilon-website
|
||||
|
||||
- role: openshift/object
|
||||
object_app: ipsilon-website
|
||||
object_template: buildconfig.yml.j2
|
||||
object_objectname: buildconfig.yml
|
||||
|
||||
- role: openshift/object
|
||||
object_app: ipsilon-website
|
||||
object_file: service.yml
|
||||
object_objectname: service.yml
|
||||
|
||||
- role: openshift/route
|
||||
route_app: ipsilon-website
|
||||
route_name: web-internal
|
||||
route_host: "ipsilon-website.apps.ocp{{ env_suffix }}.fedoraproject.org"
|
||||
route_serviceport: web
|
||||
route_servicename: web
|
||||
route_annotations:
|
||||
haproxy.router.openshift.io/timeout: 5m
|
||||
|
||||
- role: openshift/route
|
||||
route_app: ipsilon-website
|
||||
route_name: web
|
||||
route_host: "ipsilon-project.org"
|
||||
route_serviceport: web
|
||||
route_servicename: web
|
||||
route_annotations:
|
||||
haproxy.router.openshift.io/timeout: 5m
|
||||
|
||||
- role: openshift/object
|
||||
object_app: ipsilon-website
|
||||
object_template: deploymentconfig.yml.j2
|
||||
object_objectname: deploymentconfig.yml
|
||||
|
|
@ -3,5 +3,12 @@ Alias /lookaside /srv/cache/lookaside
|
|||
Options Indexes FollowSymLinks
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
|
||||
{% if env == 'staging' %}
|
||||
# Disable global mod_deflate for lookaside cache
|
||||
# to prevent double-compression and false gzip headers
|
||||
SetEnv no-gzip 1
|
||||
SetEnv dont-vary 1
|
||||
{% endif %}
|
||||
</Directory>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
app: ipsilon-website
|
||||
spec:
|
||||
ports:
|
||||
- name: web
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: ipsilon-website
|
||||
deploymentconfig: web
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
apiVersion: build.openshift.io/v1
|
||||
kind: BuildConfig
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
app: ipsilon-website
|
||||
build: ipsilon-website
|
||||
spec:
|
||||
runPolicy: Serial
|
||||
source:
|
||||
type: Git
|
||||
git:
|
||||
uri: https://pagure.io/ipsilon-website.git
|
||||
ref: master
|
||||
contextDir: /
|
||||
strategy:
|
||||
type: Docker
|
||||
output:
|
||||
to:
|
||||
kind: ImageStreamTag
|
||||
name: ipsilon-website:latest
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
||||
- type: "Generic"
|
||||
generic:
|
||||
secretReference:
|
||||
{% if env == "staging" %}
|
||||
name: "{{ ipsilon_website_stg_webhook_secret }}"
|
||||
{% else %}
|
||||
name: "{{ ipsilon_website_webhook_secret }}"
|
||||
{% endif %}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
---
|
||||
apiVersion: apps.openshift.io/v1
|
||||
kind: DeploymentConfig
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
app: ipsilon-website
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
app: ipsilon-website
|
||||
deploymentconfig: web
|
||||
strategy:
|
||||
type: Rolling
|
||||
activeDeadlineSeconds: 21600
|
||||
rollingParams:
|
||||
intervalSeconds: 1
|
||||
maxSurge: 25%
|
||||
maxUnavailable: 25%
|
||||
timeoutSeconds: 600
|
||||
updatePeriodSeconds: 1
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: ipsilon-website
|
||||
deploymentconfig: web
|
||||
spec:
|
||||
containers:
|
||||
- name: ipsilon-website
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
# protocol: TCP
|
||||
readinessProbe:
|
||||
timeoutSeconds: 5
|
||||
initialDelaySeconds: 30
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
livenessProbe:
|
||||
timeoutSeconds: 5
|
||||
initialDelaySeconds: 30
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
# resources: {}
|
||||
# terminationMessagePath: /dev/termination-log
|
||||
# terminationMessagePolicy: File
|
||||
triggers:
|
||||
- type: ConfigChange
|
||||
- type: ImageChange
|
||||
imageChangeParams:
|
||||
automatic: true
|
||||
containerNames:
|
||||
- ipsilon-website
|
||||
from:
|
||||
kind: ImageStreamTag
|
||||
name: ipsilon-website:latest
|
||||
7
roles/openshift/cluster/handlers/main.yaml
Normal file
7
roles/openshift/cluster/handlers/main.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: Apply changes to openshift
|
||||
ansible.builtin.command: "oc apply --validate=strict -f {{ cluster_filepath }}/{{ item }}"
|
||||
loop: "{{ base_templates + (stg_templates if env == 'staging' else []) }}"
|
||||
changed_when: true
|
||||
tags:
|
||||
- create-resources
|
||||
|
|
@ -10,25 +10,26 @@
|
|||
tags:
|
||||
- create-resources
|
||||
|
||||
- name: Set template lists
|
||||
ansible.builtin.set_fact:
|
||||
base_templates:
|
||||
- sysadmin-openshift-group.yml
|
||||
- sysadmin-openshift-rolebinding.yml
|
||||
- webhooks-clusterrolebinding.yml
|
||||
- forward-logs-to-log01.yml
|
||||
stg_templates:
|
||||
- sysadmin-openshift-readonly-rolebinding.yml
|
||||
- sysadmin-openshift-readonly-role.yml
|
||||
- sysadmin-openshift-readonly-group.yml
|
||||
|
||||
# generate the templates for project to be created
|
||||
- name: Copy the templates
|
||||
- name: Copy templates
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ cluster_filepath }}/{{ item }}"
|
||||
mode: "0640"
|
||||
with_items:
|
||||
- sysadmin-openshift-group.yml
|
||||
- sysadmin-openshift-rolebinding.yml
|
||||
- webhooks-clusterrolebinding.yml
|
||||
- forward-logs-to-log01.yml
|
||||
with_items: "{{ base_templates + (stg_templates if env == 'staging' else []) }}"
|
||||
register: cluster_template_result
|
||||
tags:
|
||||
- create-resources
|
||||
|
||||
# apply created openshift resources
|
||||
- name: Oc apply resources
|
||||
ansible.builtin.command: "oc apply --validate=strict -f {{ item.dest }}"
|
||||
with_items: "{{ cluster_template_result.results }}"
|
||||
when: item.changed
|
||||
notify: Apply changes to openshift
|
||||
tags:
|
||||
- create-resources
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
kind: Group
|
||||
apiVersion: user.openshift.io/v1
|
||||
metadata:
|
||||
name: "sysadmin-openshift-readonly"
|
||||
users:
|
||||
{% for item in cluster_readonly_appowners %}
|
||||
- "{{ item }}"
|
||||
{% endfor %}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
kind: Role
|
||||
apiVersion: user.openshift.io/v1
|
||||
metadata:
|
||||
name: "sysadmin-openshift-readonly"
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- endpoints
|
||||
- persistentvolumeclaims
|
||||
- persistentvolumeclaims/status
|
||||
- pods
|
||||
- replicationcontrollers
|
||||
- replicationcontrollers/scale
|
||||
- serviceaccounts
|
||||
- services
|
||||
- services/status
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
kind: RoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: "sysadmin-openshift-readonly"
|
||||
subjects:
|
||||
- kind: Group
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
name: "sysadmin-openshift-readonly"
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: cluster-readonly
|
||||
|
|
@ -12,7 +12,6 @@
|
|||
tags:
|
||||
- zabbix_agent
|
||||
- zabbix_api
|
||||
- pagure
|
||||
block:
|
||||
- name: Create {{ item.name }} cert age item
|
||||
community.zabbix.zabbix_item:
|
||||
|
|
@ -25,9 +24,12 @@
|
|||
units: 'days'
|
||||
timeout: '10s'
|
||||
interval: '12h'
|
||||
preprocessing:
|
||||
- type: check_unsupported
|
||||
error_handler: set_custom_error_message
|
||||
error_handler_params: 'failed to execute zext_ssl_cert.sh'
|
||||
params: '-1' # corresponds to 'any value' in the UI params
|
||||
tags:
|
||||
- tag: application
|
||||
value: pagure
|
||||
- tag: component
|
||||
value: ssl
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ EXPIRY=$(echo | timeout 5 openssl s_client -servername $HOST -connect $HOST:$POR
|
|||
openssl x509 -noout -enddate 2>/dev/null | cut -d= -f2)
|
||||
|
||||
if [ -z "$EXPIRY" ]; then
|
||||
echo 0
|
||||
echo "timeout connecting to $HOST"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue