wazuh / wazuh-puppet

Wazuh - Puppet module
https://wazuh.com
GNU General Public License v2.0
44 stars 132 forks source link

puppetlabs/apt version 4 onwards breaks the installation of wazuh server #29

Closed ghost closed 7 years ago

ghost commented 7 years ago

Using puppetlabs/apt version 4 I get this issue when include wazuh::server:

       Warning: Unknown variable: '::wazuh::params::default_local_files'. at /tmp/kitchen/modules/profile_wazuh/manifests/server.pp:72:42
       Warning: Unknown variable: '::wazuh::params::ossec_service_provider'. at /tmp/kitchen/modules/profile_wazuh/manifests/server.pp:79:42
       Warning: Unknown variable: '::wazuh::params::wodle_openscap_content'. at /tmp/kitchen/modules/profile_wazuh/manifests/server.pp:91:42
       Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README. at ["/tmp/kitchen/modules/wazuh/manifests/server.pp", 42]:["/tmp/kitchen/manifests/site.pp", 3]
          (at /tmp/kitchen/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
       Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README. at ["/tmp/kitchen/modules/wazuh/manifests/server.pp", 48]:["/tmp/kitchen/manifests/site.pp", 3]
          (at /tmp/kitchen/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
       Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README. at ["/tmp/kitchen/modules/wazuh/manifests/server.pp", 53]:["/tmp/kitchen/manifests/site.pp", 3]
          (at /tmp/kitchen/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
       Warning: You cannot collect exported resources without storeconfigs being set; the collection will be ignored at /tmp/kitchen/modules/wazuh/manifests/collect_agent_keys.pp:3:3
       Warning: Unknown variable: '::apt::keyserver'. at /tmp/kitchen/modules/apt/manifests/key.pp:7:44
       Error: Evaluation Error: Error while evaluating a Resource Statement, Apt::Key[wazuh]: parameter 'server' expects a String value, got Undef  at /tmp/kitchen/modules/wazuh/manifests/repo.pp:9 on node server-ubuntu-1604.vagrantup.com

If I force the installation of puppetlabs/apt version 2.4.0, everything works properly:

       Notice: Compiled catalog for server-ubuntu-1604.vagrantup.com in environment production in 0.71 seconds
       Notice: /Stage[main]/Wazuh::Repo/Apt::Key[wazuh]/Apt_key[wazuh]/ensure: created
       Notice: /Stage[main]/Apt/File[preferences]/ensure: created
       Notice: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]/content: content changed '{md5}b9de0ac9e2c9854b1bb213e362dc4e41' to '{md5}0962d70c4ec78bbfa6f3544ae0c41974'
       Notice: /Stage[main]/Wazuh::Repo/Apt::Source[wazuh]/Apt::Setting[list-wazuh]/File[/etc/apt/sources.list.d/wazuh.list]/ensure: defined content as '{md5}4143756f4b3929ecd55c1fea85b7a155'
       Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 events
       Notice: /Stage[main]/Wazuh::Server/Package[wazuh-manager]/ensure: created
       Notice: /Stage[main]/Wazuh::Server/File[/var/ossec/etc/shared/agent.conf]/ensure: defined content as '{md5}cdf47129efe9d974d50b73d6e2fa6f46'
       Notice: /Stage[main]/Wazuh::Server/File[/var/ossec/etc/rules/local_rules.xml]/content: content changed '{md5}2c4efe1cbbac9abe551b0dc942702782' to '{md5}efed07c2d4b01112473d8f3c60656499'
       Notice: /Stage[main]/Wazuh::Server/File[/var/ossec/etc/rules/local_rules.xml]/mode: mode changed '0640' to '0440'
       Notice: /Stage[main]/Wazuh::Server/File[/var/ossec/etc/decoders/local_decoder.xml]/content: content changed '{md5}13848075a6d3a8d32a675bb10b4ddc6d' to '{md5}576d3df43e2f4974b43742247d7b9360'
       Notice: /Stage[main]/Wazuh::Server/File[/var/ossec/etc/decoders/local_decoder.xml]/mode: mode changed '0640' to '0440'
       Notice: /Stage[main]/Wazuh::Server/File[/var/ossec/bin/.process_list]/ensure: defined content as '{md5}4e2ebbeec71161271f2db52cd2c4d864'
       Notice: /Stage[main]/Wazuh::Server/Concat[ossec.conf]/File[/var/ossec/etc/ossec.conf]/content: content changed '{md5}4557382e798d0e571e9b32f02b1c0174' to '{md5}70e4e093aa30393276f166ba045c998a'
       Notice: /Stage[main]/Wazuh::Server/Concat[ossec.conf]/File[/var/ossec/etc/ossec.conf]/mode: mode changed '0640' to '0440'
       Notice: /Stage[main]/Wazuh::Server/Concat[/var/ossec/etc/client.keys]/File[/var/ossec/etc/client.keys]/content: content changed '{md5}d41d8cd98f00b204e9800998ecf8427e' to '{md5}68b329da9893e34099c7d8ad5cb9c940'
       Notice: /Stage[main]/Wazuh::Server/Concat[/var/ossec/etc/client.keys]/File[/var/ossec/etc/client.keys]/mode: mode changed '0640' to '0440'
       Notice: /Stage[main]/Wazuh::Server/Service[wazuh-manager]: Triggered 'refresh' from 8 events
       Notice: Applied catalog in 12.72 seconds
jlruizmlg commented 7 years ago

Hi @rafaelfc-olx let us review this issue, thanks for report the issue

jlruizmlg commented 7 years ago

@rafaelfc-olx @jnarvaezp fixed this issue in the pull request #33, can you test please?

ghost commented 7 years ago

@jlruizmlg unfortunately its breaking for me:

root@stg-wazuhmanager-i-0abf49180f901767f:~# puppet agent -vt
Info: Using configured environment 'staging'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Syntax error at 'server' at /etc/puppetlabs/code/environments/staging/modules/wazuh/manifests/repo.pp:15:9 on node stg-wazuhmanager-i-0abf49180f901767f.my.domain.
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

There's a comma missing at line 12 in https://github.com/wazuh/wazuh-puppet/pull/33/files. After putting the comma, it works in a backwards-compatible way :)

Thanks for the quick response.

jnarvaezp commented 7 years ago

Hi @rafaelfc-olx

Thanks for the revision, the syntax error has been fixed in the repository.

JN