Help/Ansible/first_install.yaml
2025-05-29 21:55:04 +02:00

34 lines
937 B
YAML
Executable File

- name: Provotni instalace serveru
hosts: all
become: true
gather_facts: yes
tasks:
- name: Install NGINX
apt:
name: nginx-full
state: present
- name: Copy config file status
copy:
src: status_nginx
dest: /etc/nginx/sites-available/status
owner: root
group: root
mode: 0644
- name: Add value for nginx
local_action:
module: zabbix_hostmacro
server_url: http://zabbix.czech-tv.cz
login_user: sm233387
login_password: JaNa1975
host_name: "{{inventory_hostname}}"
macro_name: "{$NGINX.STUB_STATUS.PORT}"
macro_value: 8080
state: present
- name: Check system information
shell: "ln -sf /etc/nginx/sites-available/status /etc/nginx/sites-enabled/"
- name: NGINX restart
ansible.builtin.service:
name: nginx
state: restarted
enabled: true