Page MenuHomePhabricator

Strict mode enabled by default
Closed, ResolvedPublic

Description

For Puppet 8, strict mode is on by default, meaning strict defaults to
error and strict_variables defaults to true. With strict set to error,
extra validation & checks are performed and fail as an error. This
change could be a breaking change if your code does not conform to
strict mode.

Examples of code that does not conform to strict mode:

  • Accessing a variable without first defining it: notice(\$myvar)
  • Accessing a legacy fact: notice($facts['osfamily'])
  • Coercing a string into a numeric: "1" + 1

To return to the previous behavior, set, strict to warning and
strict_variables to false. PUP-11725

Evaluation

Using a pcc node configured with puppet 8 should suss out the majority
of these issues. The current count of affected nodes types is 19.
Evaluated by running a catalog compile test on a PCC puppet 8 node.

  • modules/profile/manifests/wmcs/services/maintain_dbusers.pp:82
    • Unknown variable: ::passwords::labsdbaccounts::db_user
    • Hosts: cloudcontrol1005.eqiad.wmnet
  • modules/dumps/manifests/web/fetches/kiwix.pp:27
    • The string '1001' was automatically coerced to the numerical value 1001
    • Hosts: clouddumps1001.wikimedia.org
  • modules/scap/templates/mw-deployment-vars.erb:4
    • Undefined variable 'scap::master::common_path'
    • Hosts: cloudweb1003.wikimedia.org, mwdebug1001.eqiad.wmnet
  • modules/mtail/manifests/program.pp:43
    • Unknown variable: 'notify'
    • Hosts: contint1002.wikimedia.org
  • modules/profile/manifests/cache/kafka/webrequest.pp:113
    • Unknown variable: 'profile::cache::kafka::certificate::ssl_keystore_location'
    • Hosts: cp1100.eqiad.wmnet
  • modules/profile/manifests/mariadb/grants/production.pp:52:32
    • Unknown variable: 'passwords::mysql::phabricator::phd_pass'
    • Hosts: db1125.eqiad.wmnet, es1020.eqiad.wmnet, pc1011.eqiad.wmnet, phab1004.eqiad.wmnet
  • modules/profile/manifests/cassandra.pp:7:49
    • Undefined variable 'passwords::cassandra::super_password
    • Hosts: ml-cache1001.eqiad.wmnet
  • modules/prometheus/manifests/blackbox/modules/service_catalog.pp:55:15
    • Unknown variable: 'service_modules'
    • Hosts: prometheus1005.eqiad.wmnet
  • modules/puppetmaster/manifests/geoip.pp:59:31
    • Unknown variable: 'passwords::geoip::user_id_ipinfo'
    • Hosts: puppetmaster1001.eqiad.wmnet
  • modules/profile/manifests/puppetserver/git.pp:186:55
    • Unknown variable: 'puppetserver::g10k::config_file'
    • Hosts: puppetserver1001.eqiad.wmnet
  • modules/profile/manifests/swift/storage/configure_disks.pp:18:36
    • Puppet The string '25' was automatically coerced to the numerical value 25
    • Hosts: ms-be1080.eqiad.wmnet
  • modules/wmflib/functions/service/probe/targets.pp:46:18
    • Puppet Unknown variable: 'probes'
    • Hosts: prometheus1006.eqiad.wmnet
  • Enable strict mode in puppet 7
    • Manually enable on puppetservers to test
    • Fix any unforeseen issues

Event Timeline

Change #1063239 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] mtail: remove undefined var

https://gerrit.wikimedia.org/r/1063239

jhathaway raised the priority of this task from Low to Medium.

Change #1064108 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: add explicit typecast

https://gerrit.wikimedia.org/r/1064108

Change #1064113 had a related patch set uploaded (by JHathaway; author: JHathaway):

[labs/private@master] puppet8: add db_user

https://gerrit.wikimedia.org/r/1064113

Change #1064113 merged by JHathaway:

[labs/private@master] puppet8: add db_user

https://gerrit.wikimedia.org/r/1064113

Change #1064108 merged by JHathaway:

[operations/puppet@production] puppet8: add explicit typecast

https://gerrit.wikimedia.org/r/1064108

Change #1064839 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: remove unused scap config file

https://gerrit.wikimedia.org/r/1064839

Change #1065283 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: remove ssl_keystore_location, always set ssl_key_password

https://gerrit.wikimedia.org/r/1065283

Change #1067430 had a related patch set uploaded (by JHathaway; author: JHathaway):

[labs/private@master] puppet8: add phd_pass

https://gerrit.wikimedia.org/r/1067430

Change #1067430 merged by JHathaway:

[labs/private@master] puppet8: add phd_pass

https://gerrit.wikimedia.org/r/1067430

Change #1063239 merged by JHathaway:

[operations/puppet@production] puppet8: mtail, check if notify is defined

https://gerrit.wikimedia.org/r/1063239

Change #1064839 merged by JHathaway:

[operations/puppet@production] puppet8: remove unused scap config file

https://gerrit.wikimedia.org/r/1064839

Change #1071020 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: ensure cassandra passwords are defined

https://gerrit.wikimedia.org/r/1071020

Change #1071031 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: account for unknown probe types

https://gerrit.wikimedia.org/r/1071031

Change #1071038 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: avoid relying on g10k::config_file being defined

https://gerrit.wikimedia.org/r/1071038

jhathaway updated the task description. (Show Details)

Change #1071038 merged by JHathaway:

[operations/puppet@production] puppet8: avoid relying on g10k::config_file being defined

https://gerrit.wikimedia.org/r/1071038

jhathaway updated the task description. (Show Details)

Change #1065283 merged by Ssingh:

[operations/puppet@production] puppet8: remove ssl_keystore_location, always set ssl_key_password

https://gerrit.wikimedia.org/r/1065283

Change #1071031 merged by JHathaway:

[operations/puppet@production] puppet8: account for unknown probe types

https://gerrit.wikimedia.org/r/1071031

Change #1071020 merged by Eevans:

[operations/puppet@production] puppet8: ensure cassandra passwords are defined

https://gerrit.wikimedia.org/r/1071020

Change #1072301 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: add explicit typecast

https://gerrit.wikimedia.org/r/1072301

Change #1072303 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: account for unknown probe types

https://gerrit.wikimedia.org/r/1072303

Change #1072303 merged by JHathaway:

[operations/puppet@production] puppet8: account for unknown probe types

https://gerrit.wikimedia.org/r/1072303

Change #1072301 merged by JHathaway:

[operations/puppet@production] puppet8: add explicit typecast

https://gerrit.wikimedia.org/r/1072301

Change #1073284 had a related patch set uploaded (by JHathaway; author: JHathaway):

[operations/puppet@production] puppet8: enable strict mode

https://gerrit.wikimedia.org/r/1073284

Change #1073284 merged by JHathaway:

[operations/puppet@production] puppet8: enable strict mode

https://gerrit.wikimedia.org/r/1073284

jhathaway claimed this task.

enabled in production, closing