-
-
Notifications
You must be signed in to change notification settings - Fork 238
Expand file tree
/
Copy pathsetup-kong.yml
More file actions
64 lines (54 loc) · 1.68 KB
/
setup-kong.yml
File metadata and controls
64 lines (54 loc) · 1.68 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
- name: Kong - system user
ansible.builtin.user:
name: 'kong'
state: 'present'
# Kong installation steps from http://archive.vn/3HRQx
- name: Kong - system dependencies
ansible.builtin.apt:
pkg:
- libpcre3
- openssl
- perl
- procps
- name: Kong - download deb package
get_url:
checksum: "{{ kong_deb_checksum }}"
dest: '/tmp/kong.deb'
url: "https://packages.konghq.com/public/gateway-28/deb/ubuntu/pool/{{ kong_release_target }}/main/k/ko/kong_2.8.1/{{ kong_deb }}"
- name: Kong - deb installation
ansible.builtin.apt:
deb: '/tmp/kong.deb'
- name: Kong - ensure it is NOT autoremoved
ansible.builtin.shell:
cmd: apt-mark manual kong zlib1g libpcre3 openssl perl procps
- name: Kong - configuration
ansible.builtin.template:
dest: '/etc/kong/kong.conf'
src: 'files/kong_config/kong.conf.j2'
- name: Kong - hand over ownership of /usr/local/kong to user kong
ansible.builtin.file:
owner: 'kong'
path: '/usr/local/kong'
recurse: true
# [warn] ulimit is currently set to "1024". For better performance set it to at least
# "4096" using "ulimit -n"
- name: Kong - bump up ulimit
community.general.pam_limits:
domain: 'kong'
limit_item: 'nofile'
limit_type: 'soft'
value: '4096'
- name: Kong - create env file
ansible.builtin.template:
dest: '/etc/kong/kong.env'
src: 'files/kong_config/kong.env.j2'
- name: Kong - create service file
ansible.builtin.template:
dest: '/etc/systemd/system/kong.service'
src: 'files/kong_config/kong.service.j2'
- name: Kong - disable service
ansible.builtin.systemd_service:
daemon_reload: true
enabled: false
name: 'kong'
state: 'stopped'