Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `domain_password' for Chef::Resource::Execute #39

Open
sredne opened this issue Nov 6, 2018 · 3 comments

Comments

@sredne
Copy link

sredne commented Nov 6, 2018

It looks like there might new_resource missing on line 34 of the ubuntu 16.04 resource.

PS S:\sourcecode\linux> kitchen converge post-provisioning
-----> Starting Kitchen (v1.23.2)
-----> Converging ...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 7.0.6...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
Transferring files to
Starting Chef Client, version 14.4.56
resolving cookbooks for run list: ["linux::join_domain"]
Synchronizing Cookbooks:
- ad-join (5.1.1)
- windows (5.1.4)
- linux (0.2.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: linux::join_domain
* domain_join[test.corp] action join

       ================================================================================
       Error executing action `join` on resource 'domain_join[test.corp]'
       ================================================================================

       NoMethodError
       -------------
       undefined method `domain_password' for Chef::Resource::Execute

       Cookbook Trace:
       ---------------
       /tmp/kitchen/cache/cookbooks/ad-join/resources/domain_join_ubuntu1604.rb:35:in `block (2 levels) in class_from_file'
       /tmp/kitchen/cache/cookbooks/ad-join/resources/domain_join_ubuntu1604.rb:34:in `block in class_from_file'

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/linux/recipes/join_domain.rb

        14: domain_join 'test.corp' do
        15:     domain          domain
        16:     domain_user     domain_account_username
        17:     domain_password domain_account_password
        18:     ou              'OU=Development,OU=Computer,OU=test,DC=test,DC=corp'
        19:     action :join
        20: end

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/linux/recipes/join_domain.rb:14:in `from_file'

       domain_join("test.corp") do
         action [:join]
         default_guard_interpreter :default
         declared_type :domain_join
         cookbook_name "linux"
         recipe_name "join_domain"
         domain "TEST.CORP"
         domain_user "test"
         domain_password "password"
         ou "OU=Development,OU=Computer,OU=test,DC=test,DC=corp"
       end

       System Info:
       ------------
       chef_version=14.4.56
       platform=ubuntu
       platform_version=16.04
       ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
       program_name=/opt/chef/bin/chef-client
       executable=/opt/chef/bin/chef-client


   Running handlers:
   [2018-11-06T18:44:40+00:00] ERROR: Running exception handlers
   [2018-11-06T18:44:40+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2018-11-06T18:44:40+00:00] ERROR: Exception handlers complete
   [2018-11-06T18:44:40+00:00] ERROR: Exception handlers complete
   Chef Client failed. 0 resources updated in 01 seconds
   [2018-11-06T18:44:40+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2018-11-06T18:44:40+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2018-11-06T18:44:40+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2018-11-06T18:44:40+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2018-11-06T18:44:40+00:00] FATAL: NoMethodError: domain_join[test.corp] (linux::join_domain line 14) had an error: NoMethodError: undefined method `domain_password' for Chef::Resource::Execute
   [2018-11-06T18:44:40+00:00] FATAL: NoMethodError: domain_join[test.corp] (linux::join_domain line 14) had an error: NoMethodError: undefined method `domain_password' for Chef::Resource::Execute

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Converge failed on instance . Please see .kitchen/logs/post-provisioning-ubuntu-16045.log for more details

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

@spuder
Copy link
Contributor

spuder commented Nov 6, 2018

Correct, line 35 and line 57 should both be changed from

    environment 'DOMAIN_PASS' => domain_password

to

environment 'DOMAIN_PASS' => new_resource.domain_password

I'll push change shortly. @aredeex or @jordangillespie will need to publish the change to the super market

spuder added a commit to spuder/ad-join-cookbook that referenced this issue Nov 6, 2018
aredeex added a commit that referenced this issue Nov 6, 2018
@sredne
Copy link
Author

sredne commented Dec 5, 2018

Hey @spuder ,

Do we have an ETA on when this will be published to the supermarket? I'd like to use it using the supermarket without having to pull from source.

@spuder
Copy link
Contributor

spuder commented Dec 6, 2018

@aredeex I've pushed 5.1.2 to the supermarket

knife cookbook site share "ad-join" "Operating Systems & Virtualization" -z --dry-run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants