Git Product home page Git Product logo

foreman's Issues

Registering Smart-Proxy fails on initial run by using an outdated value as URL

Given this ressource at recipes/proxy_register.rb:

foreman_smartproxy node['foreman-proxy']['registered_name'] do
  base_url node['foreman-proxy']['foreman_base_url']
  consumer_key node['foreman-proxy']['oauth_consumer_key']
  consumer_secret node['foreman-proxy']['oauth_consumer_secret']
  effective_user node['foreman-proxy']['oauth_effective_user']
  url node['foreman-proxy']['registered_proxy_url']
  only_if { node['foreman-proxy']['register'] }
  retries 3
  retry_delay 5
  action :create

This resource currently can not succeed on the first run because url is referring to a derived attribute which is changed after compile time.

Looking at attributes/foreman_proxy.rb shows that:

default['foreman-proxy']['registered_proxy_url'] = "http#{'s' if node['foreman-proxy']['ssl']}://#{node['foreman-proxy']['registered_name']}:#{registered_port}" referred by url is derived from:

default['foreman-proxy']['registered_name'] = node['fqdn']

This node attribute node[fqdn] is changed by the included hostname cookbook during the (initial) run.

I guess a possible solution could be to leverage lazy evaluation of attributes.

Missing bind file when using foreman::proxy recipe

Here is the issue:

================================================================================
           Error executing action `run` on resource 'execute[named-checkconf]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'
           ---- Begin output of /usr/sbin/named-checkconf -z /etc/bind/named.conf ----
           STDOUT: zone localhost.localdomain/IN: loaded serial 0
           zone localhost/IN: loaded serial 0
           zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
           zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
           zone 0.in-addr.arpa/IN: loaded serial 0
       zone foreman.example/IN: loading from master file master/db.foreman.example failed: file not found
           zone foreman.example/IN: not loaded due to errors.
           STDERR: _default/foreman.example/in: file not found
       ---- End output of /usr/sbin/named-checkconf -z /etc/bind/named.conf ----
           Ran /usr/sbin/named-checkconf -z /etc/bind/named.conf returned 1

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/bind/recipes/default.rb

       121: execute 'named-checkconf' do
           122:   command "/usr/sbin/named-checkconf -z #{node['bind']['conf_file']}"

       124:   notifies :enable, 'service[bind]', :immediately
           125:   notifies :start, 'service[bind]', :immediately
           126:   only_if { ::File.exist?('/usr/sbin/named-checkconf') }
           127: end
           128:

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/bind/recipes/default.rb:121:in `from_file'

           execute("named-checkconf") do
             action [:nothing]
             retries 0
             retry_delay 2
             default_guard_interpreter :execute
             command "/usr/sbin/named-checkconf -z /etc/bind/named.conf"
             backup 5
             returns 0
             declared_type :execute
             cookbook_name "bind"
             recipe_name "default"
         only_if { #code block }
           end

       Recipe: tftp::server
         * service[tftpd-hpa] action restart
       - restart service service[tftpd-hpa]
       Recipe: dhcp::_service
         * service[isc-dhcp-server] action restart

           ================================================================================
       Error executing action `restart` on resource 'service[isc-dhcp-server]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'



           ---- End output of /sbin/start isc-dhcp-server ----
           Ran /sbin/start isc-dhcp-server returned 1

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/dhcp/recipes/_service.rb

             3: service node['dhcp']['service_name'] do
             4:   supports restart: true, status: true, reload: true
             5:   action [:enable]
         6:   # use upstart on ubuntu > 9.10
         7:   case node['platform']
             8:   when 'ubuntu'
             9:     if node['platform_version'].to_f >= 9.10
        10:       provider Chef::Provider::Service::Upstart
            11:     end
            12:   end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/dhcp/recipes/_service.rb:3:in `from_file'

           service("isc-dhcp-server") do
         provider Chef::Provider::Service::Upstart
             action [:enable]
         supports {:restart=>true, :status=>true, :reload=>true}
             retries 0
             retry_delay 2
             default_guard_interpreter :default
         service_name "isc-dhcp-server"
             enabled true
         pattern "isc-dhcp-server"
         declared_type :service
             cookbook_name "dhcp"

       end

       Recipe: bind::default
         * service[bind] action reload
           - reload service service[bind]

       Running handlers:
       [2015-12-01T23:08:07+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2015-12-01T23:08:07+00:00] ERROR: Exception handlers complete
       Chef Client failed. 63 resources updated in 07 minutes 17 seconds
       [2015-12-01T23:08:07+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2015-12-01T23:08:07+00:00] ERROR: Chef::Exceptions::MultipleFailures
       [2015-12-01T23:08:08+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Judging from the bind cookbook this cookbook is using, we are missing a template file:

https://github.com/DennisBP/cookbook-bind/blob/master/recipes/default.rb#L121-L134

It's expecting example.org.erb to be present, but it's not present in either cookbook.

Fix all checks so they pass

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

The checks are not passing.

๐Ÿฅž Cookbook version

Version of the cookbook where you are encountering the issue.

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

Version of chef-client in your environment.

๐ŸŽฉ Platform details

Operating system distribution and release version. Cloud provider if running in the cloud.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

๐Ÿš“ Expected behavior

All of the checks including integration tests pass.

โž• Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

Still WIP?

Hi,
just a question, this cookbook is still in work in progress state?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.1.1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 3.0.0
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

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.