summaryrefslogtreecommitdiffstats
path: root/playbooks/update_ticketkey.yml
blob: f1ddbd2cfc908db6c598ec3a13ab72cb3b7b7171 (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
- name: make a new ssl ticketkey
  hosts: batcave01.phx2.fedoraproject.org
  user: root

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  handlers:
  - include: "{{ handlers_path }}/restart_services.yml"

  tasks:
  - name: create new production ticket key
    command: dd if=/dev/random of=/root/ticketkey_production.tkey bs=1 count=48

  - name: create new staging ticket key
    command: dd if=/dev/random of=/root/ticketkey_staging.tkey bs=1 count=48

- name: Push out new ticket key
  hosts: proxies:proxies-stg
  user: root

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  handlers:
  - include: "{{ handlers_path }}/restart_services.yml"

  tasks:

  - name: deploy ticket key
    copy: src=/root/ticketkey_{{env}}.tkey dest=/etc/httpd/ticketkey_{{env}}.tkey
          owner=root group=root mode=0600
    notify:
    - reload proxyhttpd