Please forgive my limited knowledge on puppet. I need some assistance in 
achieving what most of you would consider a very simple task. I am 
attempting to install zabbix agent below and modify the configuration file 
then reload the service. I believe the code is incomplete but i am not sure 
where the problem is because the agent run in not generating an error. from 
analysis the package is installed and the service is enabled then nothing 
else.

My thought process for the class is a follow. 1.Create a repo on the 
servers 2. install zabbix agent 3. modify the config file 4. reload the 
service.

The code can be seen below. Thank you in advance for any assistance i 
really appreciate it.

class zabbixinstall {case $operatingsystemmajrelease {
        "5": {
                yumrepo { 'zabbix3.4_repo':
                enabled  => 1,
                descr    => 'Zabbix 3.4 Repo Created by Sysad',
                baseurl  => 
'http://repo.zabbix.com/zabbix/3.4/rhel/5/$basearch/',
                gpgcheck => 1,
                gpgkey   => 'http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX',
                         }
                }
        "6": {
                yumrepo { 'zabbix3.4_repo':
                enabled  => 1,
                descr    => 'Zabbix 3.4 Repo Created by Sysad',
                baseurl  => 
'http://repo.zabbix.com/zabbix/3.4/rhel/6/$basearch/',
                gpgcheck => 1,
                gpgkey   => 'http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX',
                         }
                }
        "7": {
                yumrepo { 'zabbix3.4_repo':
                enabled  => 1,
                descr    => 'Zabbix 3.4 Repo Created by Sysad',
                baseurl  => 
'http://repo.zabbix.com/zabbix/3.4/rhel/7/$basearch/',
                gpgcheck => 1,
                gpgkey   => 'http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX',
                         }
                }
        }


        package { 'zabbix-agent':
        ensure  => 'installed',
        require => Yumrepo['zabbix3.4_repo'],
  }
        service { 'zabbix-agent':
        enable => 'true',
        ensure  => running,
        require => Package['zabbix-agent']
        }

        file_line{ 'Append a line to /etc/zabbix/zabbix_agentd.conf':
                path    => '/etc/zabbix/zabbix_agentd.conf',
                line    => "Server=server2.grp.local",
                ensure  => 'present',
                match   => '^Server\=127\.0\.0\.1',
                append_on_no_match  => 'false',
                 }
        file_line{ 'Replace line to /etc/zabbix/zabbix_agentd.conf':
                path    => '/etc/zabbix/zabbix_agentd.conf',
                line    => "ServerActive=server2.grp.local",
                ensure  => 'present',
                match   => '^ServerActive\=127\.0\.0\.1',
                append_on_no_match  => 'false',
                 }

}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1c8f121b-9ed0-4a4d-8cbf-7f79b3f77c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to