configure.yml 2.3 KB
Newer Older
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
1
2
3
- name: "set base for CLARIN repo"
  set_fact:
    clarin_home: "/dspace/{{ clarin_dspace_name }}"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
4

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
5
6
7
8
9
- name: "set base facts for CLARIN_repo"
  set_fact:
    script_dir: "{{ clarin_dspace_script_dir | default(clarin_home + '/source/utilities/project_helpers/scripts/')}}"
    src_dir: "{{ clarin_dspace_src_dir | default(clarin_home + '/source') }}"
    build_dir: "{{ clarin_dspace_build_dir | default(clarin_home + '/build') }}"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
10
    bin_dir: "{{ clarin_dspace_build_dir | default(clarin_home + '/build/bin') }}"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
11
12
13
    workspace_dir: "{{ clarin_dspace_workspace_dir | default(clarin_home + '/workspace') }}"
    log_dir: "{{ clarin_dspace_log_dir | default(clarin_home + '/log')}}"

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
14
15
16
17
18
- name: "install pexpect from pip (requirement for using ansible expect module, to automate prompting.)"
  pip:
    name: "pexpect"
  become: true

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
19
20
21
22
23
24
25
- name: "create directory for CLARINO"
  file:
    state: "directory"
    path: "{{ item }}"
    owner: "{{ clarino_user | default ('centos') }}"
  loop:
  - "{{ clarin_home }}"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
26
27
  - "{{ build_dir }}"
  - "{{ log_dir }}"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
28
29
30
31
32
33
34
35
  become: true

- name: "clone git repo"
  git:
    repo: "{{ clarin_dspace_git_repo | default('git@git.app.uib.no:clarino/clarin-dspace.git') }}"
    dest: "{{ src_dir }}"
    version: "{{ clarin_dspace_version | default('master') }}"
    accept_hostkey: "yes"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
36
    ssh_opts: "-4"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
37

38
39
40
41
42
43
44
45
46
47
48
- name: "change ownership for /var/www/html before cloning aai"
  file:
    path: "/var/www/html"
    state: "directory"
    owner: "{{ clarino_user | default ('centos') }}"
  become: true

- name: "clone aai repo"
  git:
    repo: "{{ clarin_dspace_aai_git_repo | default ('git@git.app.uib.no:clarino/aai.git') }}"
    dest: "/var/www/html/aai"
49
50
    version: "master"
    ssh_opts: "-4"
51

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
52
- name: "create symbolic link from python2 to python (python scripts in makefile uses python)"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
53
54
55
56
57
58
  file:
    src: "/usr/bin/python2"
    dest: "/usr/bin/python"
    state: "link"
  become: true

Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
59
- name: "template config to server"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
60
61
  template:
    src: "local.conf.j2"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
62
    dest: "{{ src_dir }}/local.properties"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
63
64
65
  become: true

- name: "copy variables.makefile to server"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
66
67
68
  template:
    src: "variables.makefile.j2"
    dest: "{{ src_dir }}/utilities/project_helpers/config/variable.makefile"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
69
70
71
  become: true

- name: "install prerequisites not in maven"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
72
73
  make:
    target: "install_libs"
Oyvind.Gjesdal's avatar
Oyvind.Gjesdal committed
74
75
    chdir: "{{ script_dir }}"
  become: true