Bolt duplicate vagrant nodes issue

15 views
Skip to first unread message

Brent Clark

unread,
Dec 12, 2019, 5:42:56 AM12/12/19
to puppet...@googlegroups.com
Good day Guys

I am trialing puppet bolt.

I have two vagrant instances up and running. Im trying to run bolt against.

Here in my inventory content.
https://pastebin.com/raw/2aKHbRxH

The error message I am getting is "Ignoring duplicate node in all"

I think the problem is that I have two '- name'. Could anyone please
assist and advise me on what I need to change.

Regards
Brent Clark

Michael Smith

unread,
Dec 12, 2019, 11:30:11 AM12/12/19
to puppet...@googlegroups.com
The error is because you use the name '127.0.0.1' for two different entries. It needs to be unique in any particular 'nodes' array.

One way we commonly fix that is to include the port in the name, so you would have '127.0.0.1:2200' and '127.0.0.1:2201'.

This technique is kind of mentioned in the 'Provide an alias to a node' section of https://puppet.com/docs/bolt/latest/inventory_file.html, but could be highlighted better.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/e929d31b-bf05-e35d-d3d1-5e1c3ea62b52%40gmail.com.

Lucy Wyman

unread,
Dec 12, 2019, 11:52:35 AM12/12/19
to Puppet Users
Hi Brent

The main issue here is not that you have two `- name` calls, it's that both nodes have the same name '127.0.0.1'. The `name` key must be unique for all targets, though alongside it you can define a `uri` key which sets the actual uri for the target which does not need to be unique. Given this, and that your targets already have human-readable names in the 'alias', I think you can just make the 'alias' the 'name', and give each target a 'uri' of 127.0.0.1. Additionally, we'll be dropping support for version 1 inventories early 2020, so using the version 2 inventory will make life a bit easier! You can run 'bolt project migrate' to automatically convert the inventory for you - the only thing to be aware of is that it will remove comments!

version: 2

groups:
 
- name: vagrant_nodes
    groups
:
     
- name: servers
        targets
:
         
- server1
         
- server2
targets
:
 
- name: server1
    uri
: 127.0.0.1
    config
:
      transport
: ssh
      ssh
:
        port
: 2200
        user
: vagrant
       
private-key: /Vagrant_Projects/2_node_ip_manage/.vagrant/machines/server1/virtualbox/private_key
        host
-key-check: false
 
- name: server2
    uri
: 127.0.0.1
    config
:
      transport
: ssh
      ssh
:
        port
: 2201
        user
: vagrant
       
private-key: /Vagrant_Projects/2_node_ip_manage/.vagrant/machines/server2/virtualbox/private_key
        host
-key-check: false


Brent Clark

unread,
Dec 13, 2019, 1:44:24 AM12/13/19
to puppet...@googlegroups.com
Thanks so much.

Regards
Brent

On 2019/12/12 18:33, Lucy Wyman wrote:
> Hi Brent
>
> The main issue here is not that you have two `- name` calls, it's that
> both nodes have the *same* name '127.0.0.1'. The `name` key must be
> unique for all targets, though alongside it you can define a `uri` key
> which sets the actual uri for the target which does not need to be
> unique. Given this, and that your targets already have human-readable
> names in the 'alias', I think you can just make the 'alias' the 'name',
> and give each target a 'uri' of 127.0.0.1. Additionally, we'll be
> dropping support for version 1 inventories early 2020, so using the
> version 2 inventory will make life a bit easier! You can run 'bolt
> project migrate' to automatically convert the inventory for you - the
> only thing to be aware of is that it will remove comments!
>
> |
> version:2
>
> groups:
> -name:vagrant_nodes
>     groups:
> -name:servers
>         targets:
> -server1
> -server2
> targets:
> -name:server1
>     uri:127.0.0.1
>     config:
>       transport:ssh
>       ssh:
>         port:2200
>         user:vagrant
> private-key:/Vagrant_Projects/2_node_ip_manage/.vagrant/machines/server1/virtualbox/private_key
>         host-key-check:false
> -name:server2
>     uri:127.0.0.1
>     config:
>       transport:ssh
>       ssh:
>         port:2201
>         user:vagrant
> private-key:/Vagrant_Projects/2_node_ip_manage/.vagrant/machines/server2/virtualbox/private_key
>         host-key-check:false
>
> |
>
>
>
> On Thursday, December 12, 2019 at 2:42:56 AM UTC-8, Brent wrote:
>
> Good day Guys
>
> I am trialing puppet bolt.
>
> I have two vagrant instances up and running. Im trying to run bolt
> against.
>
> Here in my inventory content.
> https://pastebin.com/raw/2aKHbRxH <https://pastebin.com/raw/2aKHbRxH>
>
> The error message I am getting is "Ignoring duplicate node in all"
>
> I think the problem is that I have two '- name'. Could anyone please
> assist and advise me on what I need to change.
>
> Regards
> Brent Clark
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/4cd06ced-3113-431c-bc0f-49bb6ee3a650%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/4cd06ced-3113-431c-bc0f-49bb6ee3a650%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages