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

agent's puppet.conf contains incorrect master hostname if fqdn hostnames are used #44

Open
jessereynolds opened this issue Sep 17, 2015 · 2 comments

Comments

@jessereynolds
Copy link

I would like to use qualified domain names as the vm names in my puppet environment so that I can use puppet to update /etc/hosts on my mac (using vagrant hosts puppetize | sudo puppet apply) and have each environment not stomp on each other. Also, it's a better simulation of real world setups.

I've tried doing this:

vagrant oscar init
vagrant oscar init-vms \
  --master master.workflow.example=puppetlabs/centos-6.6-64-nocm \
  --agent  git.workflow.example=puppetlabs/centos-6.6-64-nocm \
  --agent  agent1.workflow.example=puppetlabs/centos-6.6-64-nocm \
  --pe-version 2015.2.0
# hack in iptables disabling shell provisioners to config/roles.yaml
# increase memory allocation of master from 1GB to 3GB
vagrant up

This does along OK until an agent tries to do a puppet run. You get a certificate mismatch error:

[root@agent1 ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet
Info: Retrieving pluginfacts
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet
Info: Retrieving plugin
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet
Error: Could not retrieve catalog from remote server: Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Server hostname 'master' did not match server certificate; expected one of master.workflow.example, DNS:master.workflow.example, DNS:puppet

I can workaround this by updating the server address in /etc/puppetlabs/puppet/puppet.conf from master to master.workflow.example

Am I doing this all wrong? How else can you set up vms with qualified domain names as hostnames?

@jessereynolds
Copy link
Author

I've found the following workaround to this:

  • initialise the oscar environment as above
  • modify config/roles.yaml file as follows:
    • under the pe_bootstrap provisioner under the pe-puppet-agent role, add the following key/value pair: master: master.workflow.example

Example config/roles.yaml file:

---
roles:
  pe-puppet-master:
    private_networks:
      - {ip: '0.0.0.0', auto_network: true}
    provider:
      type: virtualbox
      customize:
        - [modifyvm, !ruby/sym id, '--memory', 3096]
    provisioners:
      - {type: hosts}
      - {type: shell, inline: "/sbin/chkconfig iptables off ; /sbin/service iptables stop"}
      - {type: pe_bootstrap, role: !ruby/sym master}

  pe-puppet-agent:
    private_networks:
      - {ip: '0.0.0.0', auto_network: true}
    provider:
      type: virtualbox
      customize:
        - [modifyvm, !ruby/sym id, '--memory', 512]
    provisioners:
      - {type: hosts}
      - {type: shell, inline: "/sbin/chkconfig iptables off ; /sbin/service iptables stop"}
      - {type: pe_bootstrap, master: 'master.workflow.example'}

@jessereynolds jessereynolds changed the title Are qualified domain names supported? agent's puppet.conf contains incorrect master hostname if fqdn hostnames are used Nov 3, 2015
@thirumoorthir
Copy link
Contributor

fixed this on #56

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