-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.yml
More file actions
93 lines (81 loc) · 2.4 KB
/
Copy pathmain.yml
File metadata and controls
93 lines (81 loc) · 2.4 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
# 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_facts['pkg_mgr'] in [ "dnf", "yum", "dnf5" ]
- name: Configure apt repository
when:
- ansible_facts['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_facts['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: Ensure artifactory home directory exists
ansible.builtin.file:
path: "{{ artifactory_home }}"
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: Install systemd service file
ansible.builtin.copy:
src: /opt/jfrog/artifactory/misc/service/artifactory.service
dest: /usr/lib/systemd/system/artifactory.service
mode: "0644"
owner: root
group: root
remote_src: true
when:
- ansible_facts['service_mgr'] == "systemd"
- name: Reload systemd daemon
ansible.builtin.systemd:
daemon_reload: true
when:
- ansible_facts['service_mgr'] == "systemd"
- name: Start and enable artifactory
ansible.builtin.service:
name: artifactory
state: started
enabled: true