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

Azure chef extension policyfile support - 1210.13.4.1 #350

Closed
sean-horn opened this issue May 20, 2021 · 8 comments
Closed

Azure chef extension policyfile support - 1210.13.4.1 #350

sean-horn opened this issue May 20, 2021 · 8 comments
Assignees

Comments

@sean-horn
Copy link

Describe the bug


Team,

We are trying to enable chef-extension on providing policyfile details while using the 1210.13.4.1 extension.
When we are trying to enable through azure arm template, as mentioned in https://github.com/chef-partners/azure-chef-extension, the chef-extension is getting deployed successfully, but policy details are not getting reflected on the node.

Can you please suggest, how to define the arm template for deploying chef-extn with policy file? We have our ARM template defined as the following. Note: We've already tried and it fails when "custom_json_attr" is kept outside "settings" with this exception: 'Could not find member 'custom_json_attr' on object of type 'TemplateResource'.

 {
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "name": "XXXXXXXXXXXXXXXXXXXX",
            "apiVersion": "2017-12-01",
            "location": "XXXXXXXXXXXXXXXXXXXX",
            "properties": {
              "publisher": "Chef.Bootstrap.WindowsAzure",
              "type": "XXXXXXXXXXXXXXXXXXXX",
              "typeHandlerVersion": "XXXXXXXXXXXXXXXXXXXX",
              "settings": {
                "custom_json_attr": {
                  "policy_name": "AzurePolicyfile",
                  "policy_group": "Development"
                },
                "bootstrap_options": {
                  "chef_node_name" : "XXXXXXXXXXXXXXXXXXXX",
                  "chef_server_url" : "XXXXXXXXXXXXXXXXXXXX",
                  "validation_client_name" : "XXXXXXXXXXXXXXXXXXXX",
                  "environment" : "XXXXXXXXXXXXXXXXXXXX"
                },
                "chef_daemon_interval": "30",
                "CHEF_LICENSE" : "accept-no-persist"
              },
              "protectedSettings": {
                  "validation_key": "XXXXXXXXXXXXXXXXXXXX"
              }
            }
          }

To Reproduce

Bootstrap a node with azure extension 1210.13.4.1 and the arm template above

Expected behavior

The node is bootstrapped and its config is defined by a policy_name and policy_group

Actual behavior

After the attempted bootstrap, the system has not had the policy_name, policy_group defined under custom_json_attr

Additional context

This seems to have been working in https://github.com/chef-partners/azure-chef-extension/releases/tag/1210.13.2.3, but has maybe stopped since then?

#259

@ayushbhatt29
Copy link
Contributor

Hi @sean-horn, this issue is not reproducible in latest version, can you please try using latest azure chef extension version 1210.13.5.2.
Thank you!

@ayushbhatt29
Copy link
Contributor

Any updates @sean-horn ?

@ayushbhatt29
Copy link
Contributor

@sean-horn this is the template that we used

 "type": "Microsoft.Compute/virtualMachines/extensions",
      "name": "***",
      "apiVersion": "2020-12-01",
      "location": "***",      
      "properties": {
      "publisher": "Chef.Bootstrap.WindowsAzure",
      "type": "ChefClient",
      "typeHandlerVersion": "1210.13",
      "settings": {
          "bootstrap_options": {
            "chef_node_name": "***",
            "chef_server_url": "***",
            "validation_client_name": "***"
           },      
           "daemon": "task",
           "chef_daemon_interval": 18,          
           "environment_variables": {
               "first": "a",
               "second": "b"           
            },
           "custom_json_attr": {
               "policy_name": "ayushpolicy",
               "policy_group": "ayu-policygroup"
           },          
           "protectedSettings": {
              "validation_key": "***"                     
            }
        }     

We are able to see policy_name and policy_group in chef/0.settings file under custom_json_attr option as well as in node generated in chef-manage portal also.

@ayushbhatt29
Copy link
Contributor

ayushbhatt29 commented Jun 11, 2021

@sean-horn we will be closing this issue as it is not occurring with latest version, you can reopen the issue if it reoccurs.
For any further assistance please let us know.

Thank you!

@ayushbhatt29
Copy link
Contributor

@sean-horn We have tested with ubuntu20 and ubuntu18 by deploying azure chef extension with template and we are getting policyname and policy_group in our node.

Can you please provide all log files from your vm - i.e chef.client.log , custom.log and waagent.log so we can debug further into it.

In linux the location for these logs will be - /var/log/azure/Chef.Bootstrap.WindowsAzure.LinuxChefClient/chef-client.log , /var/log/azure/custom.log and /var/log/waagent.log

Thank you!

@sean-horn
Copy link
Author

Thanks for the update, @ayushbhatt29 I'll ask the customer to review and that they should respond here.

@ayushbhatt29
Copy link
Contributor

Any updates @sean-horn ?

@ayushbhatt29
Copy link
Contributor

Hi @sean-horn, we will be closing this issue, feel free to reopen the issue if it reoccurs.
For any further assistance please let us know.

Thank you!

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