-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.yml
68 lines (59 loc) · 1.74 KB
/
main.yml
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
---
# tasks file for artifactory
- name: Import assert.yml
ansible.builtin.import_tasks:
file: assert.yml
run_once: true
delegate_to: localhost
- name: Install yum repository
ansible.builtin.get_url:
url: "https://releases.jfrog.io/artifactory/artifactory-rpms/artifactory-rpms.repo"
dest: /etc/yum.repos.d/bintray-jfrog-artifactory-rpms.repo
mode: "0640"
when:
- ansible_pkg_mgr in [ "dnf", "yum" ]
- name: Configure apt repository
when:
- ansible_pkg_mgr in [ "apt" ]
block:
- name: Trust gpg key
ansible.builtin.apt_key:
url: "https://releases.jfrog.io/artifactory/api/gpg/key/public"
state: present
validate_certs: false
- name: Install deb repository
ansible.builtin.apt_repository:
repo: "deb https://releases.jfrog.io/artifactory/artifactory-debs {{ ansible_distribution_release | lower }} main"
state: present
- name: Install package
ansible.builtin.package:
name: "{{ artifactory_package }}"
state: present
- name: Ensure artifactory_file_store_dir exists
ansible.builtin.file:
path: "{{ artifactory_file_store_dir }}"
state: directory
mode: "0755"
owner: artifactory
group: artifactory
- name: Configure artifactory
ansible.builtin.template:
src: binarystore.xml.j2
dest: "{{ artifactory_home }}/binarystore.xml"
mode: "0644"
owner: artifactory
group: artifactory
notify:
- Restart artifactory
- name: Set ownership for artifactory_logs
ansible.builtin.file:
path: "{{ artifactory_logs }}"
state: directory
mode: "0755"
owner: artifactory
group: artifactory
- name: Start and enable artifactory
ansible.builtin.service:
name: artifactory
state: started
enabled: true