Giter Club home page Giter Club logo

Comments (5)

rikwasmus avatar rikwasmus commented on May 24, 2024

Hm, merging config like that appears (which is very handy for a multiple datacenter setup etc.) was also only working for me after a local edit....

-  $config_hash_real = merge($config_defaults, $config_hash)
+  $config_hash_real = merge($config_defaults, hiera_hash('consul::config_hash'),$config_hash)

... which apparently had something to do with 76bc1ef ... but beside that little tidbit change, I would be running v0.4.6 now.

from puppet-consul.

solarkennedy avatar solarkennedy commented on May 24, 2024

This surprises me because we have a test for this:
https://github.com/solarkennedy/puppet-consul/blob/master/spec/classes/init_spec.rb#L247

If there was a dependency loop when settings consul::services then that test would fail to compile?

from puppet-consul.

tayzlor avatar tayzlor commented on May 24, 2024

Im hitting this as well -

Error: Could not apply complete catalog: Found 1 dependency cycle: DEBUG [9817a86d] DEBUG [9817a86d] (File[/etc/consul/service_haproxy.json] => Class[Consul::Run_service] => Service[consul] => Class[Consul::Run_service] => Class[Consul] => Consul::Service[haproxy] => File[/etc/consul/service_haproxy.json]) DEBUG [9817a86d]

from puppet-consul.

rikwasmus avatar rikwasmus commented on May 24, 2024

It could be it's about an incomplete consul definition which causes it. Once I hiera_merge it like mentioned, the problem disappears, but without merging (which granted, would result in an incomplete / faulty consul config), this dependency cycle happens, so with just:

consul::config_hash:
  log_level: 'INFO'
  server: true
  bootstrap_expect: 3
  ui_dir: '/usr/share/consul/web-ui'
  client_addr: '0.0.0.0'

consul::services:
  'zookeeper':
    tags: [ 'mesos' , 'master' ]
    port: 2181

Arguable, this is incomplete, but probably it gives more clear error messages when:

  • either defaults for the missing data which causes the loop are provided
  • or missing data which causes the loop is checked and the code is aborted there & then

from puppet-consul.

tayzlor avatar tayzlor commented on May 24, 2024

Changing the merge() function as you describe above makes no difference for me, I am still receiving the same error. Having a look into it now...

Changing the spec test to

context "When the user provides a hash of services" do
    let (:params) {{
      :config_hash => {
        'log_level' => 'INFO',
        'server'    => 'true',
        'bootstrap_expect' => 3,
        'ui_dir' => '/usr/share/consul/web-ui',
        'client_addr' => '0.0.0.0'
      },
      :services => {
        'test_service1' => {
          'port' => '5',
          'tags' => ['tag1', 'tag2']
        }
      }
    }}

    it { should contain_consul__service('test_service1').with_port('5') }
    it { should have_consul__service_resource_count(1) }
  end

still does not cause the spec test to fail for some reason (but I still definitely have the cycle issue)

from puppet-consul.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.