0420d606de
* create local subversion server for tests * fix sanity issues * don't touch system config when bringing up site * removed original setup files * fix opensuse config
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
---
|
|
- name: load OS specific vars
|
|
include_vars: '{{ ansible_os_family }}.yml'
|
|
|
|
- name: install SVN pre-reqs
|
|
package:
|
|
name: '{{ subversion_packages }}'
|
|
state: present
|
|
|
|
- name: create SVN home folder
|
|
file:
|
|
path: '{{ subversion_server_dir }}'
|
|
state: directory
|
|
|
|
- name: set SELinux security context for SVN folder
|
|
sefcontext:
|
|
target: '{{ subversion_server_dir }}(/.*)?'
|
|
setype: '{{ item }}'
|
|
state: present
|
|
when: ansible_selinux.status == "enabled"
|
|
with_items:
|
|
- httpd_sys_content_t
|
|
- httpd_sys_rw_content_t
|
|
|
|
- name: apply new SELinux context to filesystem
|
|
command: restorecon -irv {{ subversion_server_dir | quote }}
|
|
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: apply ownership for all SVN directories
|
|
file:
|
|
path: '{{ subversion_server_dir }}'
|
|
owner: '{{ apache_user }}'
|
|
group: '{{ apache_group }}'
|
|
recurse: True
|
|
|
|
- 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: start test Apache SVN site - non Red Hat
|
|
command: apachectl -k start -f {{ subversion_server_dir }}/subversion.conf
|
|
when: not ansible_os_family == 'RedHat'
|
|
|
|
# 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
|
|
when: ansible_os_family == 'RedHat'
|