| main.yml - ansible-roles - A collection of ansible roles I have created over th… | |
| git clone git://jay.scot/ansible-roles | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| main.yml (1607B) | |
| --- | |
| 1 --- | |
| 2 - name: Include variables | |
| 3 include_tasks: variables.yml | |
| 4 | |
| 5 - name: Debian tasks | |
| 6 include_tasks: setup-Debian.yml | |
| 7 when: ansible_os_family == 'Debian' | |
| 8 | |
| 9 - name: Redhat tasks | |
| 10 include_tasks: setup-RedHat.yml | |
| 11 when: ansible_os_family == 'RedHat' | |
| 12 | |
| 13 - name: Git clone stagit | |
| 14 git: | |
| 15 repo: "{{ stagit.repo_url }}" | |
| 16 dest: "{{ stagit.build_path }}" | |
| 17 version: "{{ stagit.version }}" | |
| 18 update: false | |
| 19 force: false | |
| 20 depth: 1 | |
| 21 register: git_updated | |
| 22 | |
| 23 - name: Make install stagit it | |
| 24 make: | |
| 25 chdir: "{{ stagit.build_path }}" | |
| 26 target: install | |
| 27 when: git_updated.changed | |
| 28 | |
| 29 - name: Copy stagit create script | |
| 30 template: | |
| 31 src: "create_index.j2" | |
| 32 dest: "{{ stagit.install_path }}/create_index" | |
| 33 owner: "{{ stagit.user }}" | |
| 34 group: "{{ stagit.user }}" | |
| 35 mode: '755' | |
| 36 notify: reindex stagit | |
| 37 | |
| 38 - name: Copy stagit posthook script | |
| 39 template: | |
| 40 src: "posthook.j2" | |
| 41 dest: "{{ stagit.install_path }}/posthook" | |
| 42 owner: "{{ stagit.user }}" | |
| 43 group: "{{ stagit.user }}" | |
| 44 mode: '755' | |
| 45 notify: reindex stagit | |
| 46 when: stagit.posthook_enabled | |
| 47 | |
| 48 - name: Create HTML and assets directory | |
| 49 file: | |
| 50 path: "{{ stagit.html_path }}/assets" | |
| 51 state: directory | |
| 52 owner: "{{ stagit.user }}" | |
| 53 group: "{{ stagit.user }}" | |
| 54 mode: '0755' | |
| 55 | |
| 56 - name: Create cron for stagit index | |
| 57 cron: | |
| 58 name: stagit update | |
| 59 minute: "*/10" | |
| 60 user: "{{ stagit.user }}" | |
| 61 job: "{{ stagit.install_path }}/create_index" | |
| 62 when: stagit.cron_enabled | |
| 63 | |
| 64 - name: Disable cron for stagit index | |
| 65 cron: | |
| 66 name: stagit update | |
| 67 user: "{{ stagit.user }}" | |
| 68 state: absent | |
| 69 when: not stagit.cron_enabled |