Error when running the ansible playbook #11471

Closed
Brucius opened this Issue Jul 10, 2018 — with docs.microsoft.com · 11 comments

Comments

Projects
None yet
4 participants

Hi, running into an error when I ran the playbook. I've modified the ssh path and the key data. This is the error output I'm getting.

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error creating or updating virtual machine myVM - Azure Error: InvalidParameter\nMessage: Destination path for SSH public keys is currently limited to its default value /home/oaker/.ssh/authorized_keys  due to a known issue in Linux provisioning agent.\nTarget: linuxConfiguration.ssh.publicKeys.path"

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@MicahMcKittrick-MSFT

This comment has been minimized.

Show comment
Hide comment
@MicahMcKittrick-MSFT

MicahMcKittrick-MSFT Jul 10, 2018

Contributor

Thanks for the feedback! We are currently investigating and will update you shortly.

Contributor

MicahMcKittrick-MSFT commented Jul 10, 2018

Thanks for the feedback! We are currently investigating and will update you shortly.

@MicahMcKittrick-MSFT

This comment has been minimized.

Show comment
Hide comment
@MicahMcKittrick-MSFT

MicahMcKittrick-MSFT Jul 10, 2018

Contributor

@Brucius at which point in the doc is it failing? When you attempt to create the VM? Or when you create the Ansible Playbook?

Contributor

MicahMcKittrick-MSFT commented Jul 10, 2018

@Brucius at which point in the doc is it failing? When you attempt to create the VM? Or when you create the Ansible Playbook?

@Brucius

This comment has been minimized.

Show comment
Hide comment
@Brucius

Brucius Jul 11, 2018

hello @MicahMcKittrick-MSFT I'm getting the error when i ran the ansible playbook to create the VM. I have double checked my ssh public key data and the directory too.

ansible-playbook azure_create_vm.yml

Brucius commented Jul 11, 2018

hello @MicahMcKittrick-MSFT I'm getting the error when i ran the ansible playbook to create the VM. I have double checked my ssh public key data and the directory too.

ansible-playbook azure_create_vm.yml
@MicahMcKittrick-MSFT

This comment has been minimized.

Show comment
Hide comment
@MicahMcKittrick-MSFT

MicahMcKittrick-MSFT Jul 11, 2018

Contributor

can you post your code here? Just remove any private info

Contributor

MicahMcKittrick-MSFT commented Jul 11, 2018

can you post your code here? Just remove any private info

@Brucius

This comment has been minimized.

Show comment
Hide comment
@Brucius

Brucius Jul 12, 2018

Here you go.

- name: Create Azure VM
  hosts: localhost
  connection: local
  tasks:
  - name: Create VM
    azure_rm_virtualmachine:
      resource_group: myResourceGroup
      name: myVM
      vm_size: Standard_DS1_v2
      admin_username: oaker
      ssh_password_enabled: false
      ssh_public_keys:
        - path: /home/oaker/.ssh/authorized_key
          key_data: "ssh-rsa <data>"
      image:
        offer: CentOS
        publisher: OpenLogic
        sku: '7.5'
        version: latest

Brucius commented Jul 12, 2018

Here you go.

- name: Create Azure VM
  hosts: localhost
  connection: local
  tasks:
  - name: Create VM
    azure_rm_virtualmachine:
      resource_group: myResourceGroup
      name: myVM
      vm_size: Standard_DS1_v2
      admin_username: oaker
      ssh_password_enabled: false
      ssh_public_keys:
        - path: /home/oaker/.ssh/authorized_key
          key_data: "ssh-rsa <data>"
      image:
        offer: CentOS
        publisher: OpenLogic
        sku: '7.5'
        version: latest
@MicahMcKittrick-MSFT

This comment has been minimized.

Show comment
Hide comment
@MicahMcKittrick-MSFT

MicahMcKittrick-MSFT Jul 12, 2018

Contributor

@cynthn do you have any thoughts on this one? I have only using ansible a bit but I am not seeing any issues with the code

Contributor

MicahMcKittrick-MSFT commented Jul 12, 2018

@cynthn do you have any thoughts on this one? I have only using ansible a bit but I am not seeing any issues with the code

@cynthn

This comment has been minimized.

Show comment
Hide comment
@cynthn

cynthn Jul 12, 2018

Contributor

@Brucius @MicahMcKittrick-MSFT I haven't walked through the Ansible content yet (Iain was the previous owner and he has moved on to containers). But, there are quite a few Ansible playbooks for Azure available here: http://www.oddjack.com/?certs=Azure-Samples/ansible-playbooks and from what I can see, at least some of them refer to ssh keys with a slightly different format.

Contributor

cynthn commented Jul 12, 2018

@Brucius @MicahMcKittrick-MSFT I haven't walked through the Ansible content yet (Iain was the previous owner and he has moved on to containers). But, there are quite a few Ansible playbooks for Azure available here: http://www.oddjack.com/?certs=Azure-Samples/ansible-playbooks and from what I can see, at least some of them refer to ssh keys with a slightly different format.

@MicahMcKittrick-MSFT

This comment has been minimized.

Show comment
Hide comment
@MicahMcKittrick-MSFT

MicahMcKittrick-MSFT Jul 13, 2018

Contributor

@Brucius reviewing the error you are getting and your code I am curious if the issue is with the -path you have set.

The error states: Destination path for SSH public keys is currently limited to its default value /home/oaker/.ssh/authorized_keys

I see your path is /home/oaker/.ssh/authorized_key

Could you try modifying the path to /home/oaker/.ssh/authorized_keys instead of /home/oaker/.ssh/authorized_key

Contributor

MicahMcKittrick-MSFT commented Jul 13, 2018

@Brucius reviewing the error you are getting and your code I am curious if the issue is with the -path you have set.

The error states: Destination path for SSH public keys is currently limited to its default value /home/oaker/.ssh/authorized_keys

I see your path is /home/oaker/.ssh/authorized_key

Could you try modifying the path to /home/oaker/.ssh/authorized_keys instead of /home/oaker/.ssh/authorized_key

@Brucius

This comment has been minimized.

Show comment
Hide comment
@Brucius

Brucius Jul 15, 2018

@MicahMcKittrick-MSFT ahh it worked! Such a silly mistake. Thank you very much for the help.

Brucius commented Jul 15, 2018

@MicahMcKittrick-MSFT ahh it worked! Such a silly mistake. Thank you very much for the help.

@Brucius

This comment has been minimized.

Show comment
Hide comment
@Brucius

Brucius Jul 15, 2018

Should I close this issue now?

Brucius commented Jul 15, 2018

Should I close this issue now?

@MicahMcKittrick-MSFT

This comment has been minimized.

Show comment
Hide comment
@MicahMcKittrick-MSFT

MicahMcKittrick-MSFT Jul 16, 2018

Contributor

Thanks @Brucius! No worries I missed that littler error as well :) Sometimes it takes a few eyes to catch the simple ones :)

Contributor

MicahMcKittrick-MSFT commented Jul 16, 2018

Thanks @Brucius! No worries I missed that littler error as well :) Sometimes it takes a few eyes to catch the simple ones :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment