puppetlabs / puppetlabs-docker

The Puppet Docker repository
Apache License 2.0
90 stars 307 forks source link

swarm_init generates empty strings for all params #385

Closed mfergus1 closed 5 years ago

mfergus1 commented 5 years ago

What you expected to happen?

Swarm init to pass when optional params are not set. For example, cert_expiry does not have to be assigned and swarm init should succeed.

What happened?

When the swarm init occurs, cert-expiry has been assigned an empty string. Error: 'docker swarm init --advertise-addr '10.0.0.1' --cert-expiry '' --dispatcher-heartbeat '' --external-ca '' --listen-addr '10.0.0.1' --max-snapshots '' --snapshot-interval ''' returned 125 instead of one of [0]

How to reproduce it?

docker::swarm {"swarmmaster${::cluster}-${::networking['ip']}": init => true, advertise_addr => $::networking['ip'], listen_addr => $::networking['ip'], }

The workaround has been to assign "undef" to the parameters that end up with empty strings that cause errors.

Anything else we need to know?

Versions:

$ puppet --version
puppet --version
5.5.8
$ docker version
docker --version
Docker version 18.09.0, build 4d60db4
$ facter os
{
  architecture => "amd64",
  distro => {
    codename => "xenial",
    description => "Ubuntu 16.04.5 LTS",
    id => "Ubuntu",
    release => {
      full => "16.04",
      major => "16.04"
    }
  },
  family => "Debian",
  hardware => "x86_64",
  name => "Ubuntu",
  release => {
    full => "16.04",
    major => "16.04"
  },
  selinux => {
    enabled => false
  }
}
$ puppet module list

/etc/puppetlabs/code/environments/production/modules ├── bryana-ec2tagfacts (v0.3.0) ├── dhoppe-fail2ban (v1.3.5) ├── ghoneycutt-dnsclient (v3.6.0) ├── logdna-logdna (v0.4.0) ├── lwf-remote_file (v1.1.3) ├── pcfens-ca_cert (v2.1.0) ├── puppet-extlib (v1.1.0) ├── puppet-nginx (v0.15.0) ├── puppet-unattended_upgrades (v3.2.1) ├── puppetlabs-apt (v4.5.1) ├── puppetlabs-concat (v4.2.1) ├── puppetlabs-docker (v2.0.0) ├── puppetlabs-firewall (v1.14.0) ├── puppetlabs-inifile (v2.4.0) ├── puppetlabs-motd (v2.1.1) ├── puppetlabs-ntp (v7.3.0) ├── puppetlabs-package (v0.3.0) ├── puppetlabs-powershell (v2.2.0) ├── puppetlabs-reboot (v2.1.1) ├── puppetlabs-registry (v2.1.0) ├── puppetlabs-stdlib (v4.25.1) ├── puppetlabs-translate (v1.1.0) ├── puppetlabs-yumrepo_core (v1.0.2) ├── saz-ssh (v4.0.0) ├── saz-sudo (v5.0.0) ├── saz-timezone (v5.0.2) ├── stahnma-epel (v1.3.1) ├── stm-debconf (v2.3.0) ├── tedivm-psad (v1.2.1) └── thias-sysctl (v1.0.6)

Logs:

Paste any relevant logs from a puppet run
davejrt commented 5 years ago

Hi @mfergus1 I can only replicate this if using older versions of the module and puppet6. Using the versions you've specified above I don't get that error.

davejrt commented 5 years ago

Closing due to inactivity. Feel free to reopen with more info.