summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/subversion/roles/subversion/tasks/setup.yml
blob: 3cf5af56ee4de1379cd519d9946efb12e9f81b80 (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
---
- name: clean out the checkout dir
  file:
    path: '{{ subversion_test_dir }}'
    state: '{{ item }}'
  loop:
  - absent
  - directory

- name: install SVN pre-reqs
  package:
    name: '{{ subversion_packages }}'
    state: present
  when: ansible_distribution != 'Alpine'

- name: install SVN pre-reqs - Alpine
  command: 'apk add -U -u {{ subversion_packages|join(" ") }}'
  when: ansible_distribution == 'Alpine'

- name: upgrade SVN pre-reqs
  package:
    name: '{{ upgrade_packages }}'
    state: latest
  when:
    - upgrade_packages | default([])

- name: create SVN home folder
  file:
    path: '{{ subversion_server_dir }}'
    state: directory

- name: setup selinux when enabled
  include_tasks: setup_selinux.yml
  when: ansible_selinux.status == "enabled"

- name: template out configuration file
  template:
    src: subversion.conf.j2
    dest: '{{ subversion_server_dir }}/subversion.conf'

- name: create a test repository
  script: create_repo.sh {{ subversion_repo_name }}
  args:
    chdir: '{{ subversion_server_dir }}'
    creates: '{{ subversion_server_dir }}/{{ subversion_repo_name }}'

- name: add test user to htpasswd for Subversion site
  htpasswd:
    path: '{{ subversion_server_dir }}/svn-auth-users'
    name: '{{ subversion_username }}'
    password: '{{ subversion_password }}'
    state: present

- name: apply ownership for all SVN directories
  file:
    path: '{{ subversion_server_dir }}'
    owner: '{{ apache_user }}'
    group: '{{ apache_group }}'
    recurse: True

- name: start test Apache SVN site - non Red Hat
  command: apachectl -k start -f {{ subversion_server_dir }}/subversion.conf
  async: 3600  # We kill apache manually in the clean up phase
  poll: 0
  when: ansible_os_family not in ['RedHat', 'Alpine']

# On Red Hat based OS', we can't use apachectl to start up own instance, just use the raw httpd
- name: start test Apache SVN site - Red Hat
  command: httpd -k start -f {{ subversion_server_dir }}/subversion.conf
  async: 3600  # We kill apache manually in the clean up phase
  poll: 0
  when: ansible_os_family in ['RedHat', 'Alpine']