From 03bd5be6de02ffebe13d85083b5998d9c5a347f7 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 8 May 2017 18:13:21 +0300 Subject: Handle ssh keys as content; restart apache after cgit --- roles/gitano_server/handlers/main.yml | 5 +++++ roles/gitano_server/tasks/cgit.yml | 3 +++ roles/gitano_server/tasks/gitano.yml | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 roles/gitano_server/handlers/main.yml (limited to 'roles') diff --git a/roles/gitano_server/handlers/main.yml b/roles/gitano_server/handlers/main.yml new file mode 100644 index 0000000..33b5c8f --- /dev/null +++ b/roles/gitano_server/handlers/main.yml @@ -0,0 +1,5 @@ +- name: restart apache2 + systemd: + name: apache2 + state: restarted + enabled: yes diff --git a/roles/gitano_server/tasks/cgit.yml b/roles/gitano_server/tasks/cgit.yml index fff0d93..ff0375a 100644 --- a/roles/gitano_server/tasks/cgit.yml +++ b/roles/gitano_server/tasks/cgit.yml @@ -35,6 +35,7 @@ group: root mode: 0755 with_items: "{{ cgit_hosts }}" + notify: restart apache2 - name: install apache virtualhosts template: @@ -44,7 +45,9 @@ group: root mode: 0755 with_items: "{{ cgit_hosts }}" + notify: restart apache2 - name: enable virtualhosts shell: "a2ensite {{ item }}" with_items: "{{ cgit_hosts }}" + notify: restart apache2 diff --git a/roles/gitano_server/tasks/gitano.yml b/roles/gitano_server/tasks/gitano.yml index 7d7b4fb..d9b091d 100644 --- a/roles/gitano_server/tasks/gitano.yml +++ b/roles/gitano_server/tasks/gitano.yml @@ -11,11 +11,11 @@ authorized_key: user: git state: present - key: "{{ lookup('file', gitano_bypass_pub) }}" + key: "{{ gitano_bypass_pub }}" - name: copy over gitano admin public key copy: - src: "{{ gitano_admin_pub }}" + content: "{{ gitano_admin_pub }}" dest: /home/git/admin.pub owner: git group: git @@ -23,7 +23,7 @@ - name: copy over gitano bypass public key copy: - src: "{{ gitano_bypass_pub }}" + content: "{{ gitano_bypass_pub }}" dest: /home/git/bypass.pub owner: git group: git -- cgit v1.2.1