You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.5 KiB
47 lines
1.5 KiB
2 years ago
|
- name: Basic InfluxDB server setup
|
||
|
hosts: influxdb
|
||
|
tasks:
|
||
|
- name: Verifying dependencies
|
||
|
ansible.builtin.package:
|
||
|
name:
|
||
|
- gpg
|
||
|
- nginx
|
||
|
state: latest
|
||
|
- name: Verifying repository key is present
|
||
|
ansible.builtin.get_url:
|
||
|
dest: /usr/share/keyrings/influxdb.key
|
||
|
url: https://repos.influxdata.com/influxdb.key
|
||
|
checksum: "sha256:23a1c8836f0afc5ed24e0486339d7cc8f6790b83886c4c96995b88a061c5bb5d"
|
||
|
mode: '0444'
|
||
|
- name: Performing GPG key magics
|
||
|
ansible.builtin.command:
|
||
|
cmd: "gpg --output /etc/apt/trusted.gpg.d/influxdb.gpg --dearmor /usr/share/keyrings/influxdb.key"
|
||
|
creates: /etc/apt/trusted.gpg.d/influxdb.gpg
|
||
|
- name: Verifying repository installed
|
||
|
ansible.builtin.apt_repository:
|
||
|
repo: deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/debian stable main
|
||
|
filename: influxdata.list
|
||
|
state: present
|
||
|
- name: Performing APT cache update
|
||
|
apt:
|
||
|
upgrade: no
|
||
|
update_cache: yes
|
||
|
cache_valid_time: 86400
|
||
|
- name: Installing influxdb
|
||
|
ansible.builtin.package:
|
||
|
name:
|
||
|
- influxdb2
|
||
|
- influxdb2-cli
|
||
|
state: latest
|
||
|
- name: Start and enable influxdb services
|
||
|
ansible.builtin.service:
|
||
|
name: influxdb
|
||
|
state: started
|
||
|
enabled: true
|
||
|
- name: Start and enable nginx services
|
||
|
ansible.builtin.service:
|
||
|
name: nginx
|
||
|
state: started
|
||
|
enabled: true
|
||
|
|