community.zabbix icon indicating copy to clipboard operation
community.zabbix copied to clipboard

Can`t change ServerName zabbix.example.com

Open patsevanton opened this issue 3 years ago • 1 comments

SUMMARY

ServerName zabbix.example.com in /etc/apache2/sites-available/zabbix.conf

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Zabbix web

ANSIBLE VERSION
ansible [core 2.12.2]
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
CONFIGURATION
CALLBACKS_ENABLED(/home/user/github/infrastructure-as-a-code-example/zabbix-community/ansible.cfg) = ['profile_tasks']
DEFAULT_GATHERING(/home/user/github/infrastructure-as-a-code-example/zabbix-community/ansible.cfg) = smart
DEFAULT_STDOUT_CALLBACK(/home/user/github/infrastructure-as-a-code-example/zabbix-community/ansible.cfg) = yaml
OS / ENVIRONMENT / Zabbix Version

Server where ansible

cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"

Remote server

cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
STEPS TO REPRODUCE
---
- name: Installing Zabbix
  hosts: zabbix_server
  become: true
  collections:
    - community.zabbix
  roles:
    - role: geerlingguy.apache
    - role: geerlingguy.php
    - role: geerlingguy.apache-php-fpm
    - role: zabbix_web
Inventory
all:
  children:
    zabbix:
      hosts:
        zabbix_server:
          ansible_host: xxxx
          vars:
            zabbix_url: "http://zabbix.xxxxx.sslip.io"
            zabbix_apache_servername : "http://zabbix.xxxx.sslip.io"
  vars:
    ansible_user:  ubuntu
    ansible_ssh_private_key_file: ~/.ssh/id_rsa
ACTUAL RESULTS

cat /etc/apache2/sites-available/zabbix.conf

<VirtualHost *:80>
  ServerName zabbix.example.com

patsevanton avatar Apr 21 '22 08:04 patsevanton

Same issue with inventory

all:
  children:
    zabbix:
      hosts:
        zabbix_server:
          ansible_host: xxxx
          vars:
            zabbix_api_server_url: "zabbix.xxx.sslip.io"

  vars:
    ansible_user:  ubuntu
    ansible_ssh_private_key_file: ~/.ssh/id_rsa

patsevanton avatar Apr 21 '22 08:04 patsevanton

I realize this ticket is beyond old but the correct variable should be zabbix_api_server_url.

pyrodie18 avatar Oct 02 '23 03:10 pyrodie18