def create_simp_item_factory_yaml(explicit_query_required)
if (explicit_query_required)
query_options = ''
else
query_options = 'SKIPQUERY SILENT'
end
"# The Config::Item list is really a conditional tree. Some Items can\n# prepend additional Items to the queue, depending on the answer.\n#\n# This YAML describes the Item structure appropriate for 'simp'\n# 'simp-lite', and 'poss' scenarios. The format is:\n#\n# - ItemA\n# - ItemB\n# answer1:\n# - ItemC\n# - ItemD\n# answer2:\n# - ItemE\n# - ItemF\n# - ItemG\n#\n# modifers:\n# FILE=value = set the Item's .file to value\n# DRYRUNAPPLY = make sure this Item's apply() is called when the\n# :dry_run option is selected; (Normally an Item's\n# .skip_apply is set to prevent the apply() from running\n# when :dry_run is selected.)\n# NOAPPLY = set the Item's .skip_apply ; Item.apply() will do nothing\n# USERAPPLY = execute Item's apply() even when running non-privileged\n# SILENT = set the Item's .silent ; suppresses stdout console/log output;\n# This option is best used in conjuction with SKIPQUERY for\n# Items for which no user interaction is required (i.e.,\n# Items for which internal logic can be used to figure\n# out their correct values).\n# SKIPQUERY = set the Item's .skip_query ; Item will use default_value\n# NOYAML = set the Item's .skip_yaml ; no YAML for Item will be written\n# GENERATENOQUERY = set the PasswordItem's .generate_option to :generate_no_query\n# NEVERGENERATE = set the PasswordItem's .generate_option to :never_generate\n#\n#\n# WARNING: Order matters, as some Items require settings from other Items.\n# For example, several Items require cli::network::hostname, which is\n# set by CliNetworkHostname.\n---\n# ==== Initial actions ====\n- CliIsSimpEnvironmentInstalled SKIPQUERY SILENT: # don't ever prompt, just discover current value\nfalse:\n- CopySimpToEnvironmentsAction # Can't do our config, if this hasn't happened\n- CliSimpScenario SKIPQUERY SILENT # don't prompt; this value should already set\n- SetSiteScenarioAction\n- SimpOptionsFips SKIPQUERY SILENT: # don't ever prompt, just discover current setting\ntrue:\n- SetPuppetDigestAlgorithmAction # digest algorithm affects any puppet actions, so do it first!\n\n# ==== Network ====\n- CliNetworkInterface\n- CliSetUpNIC: # Network info gathered and/or set here is needed by many Items\ntrue:\n- CliNetworkDHCP:\nstatic: # gather info first, then configure network\n- CliNetworkHostname\n- CliNetworkIPAddress\n- CliNetworkNetmask\n- CliNetworkGateway\n- SimpOptionsDNSServers\n- SimpOptionsDNSSearch\n- ConfigureNetworkAction\ndhcp: # (minimally) configure network, then get info (silently)\n- ConfigureNetworkAction\n- CliNetworkHostname SKIPQUERY SILENT\n- CliNetworkIPAddress SKIPQUERY SILENT\n- CliNetworkNetmask SKIPQUERY SILENT\n- CliNetworkGateway SKIPQUERY SILENT\n- SimpOptionsDNSServers SKIPQUERY SILENT\n- SimpOptionsDNSSearch SKIPQUERY SILENT\nfalse: # don't configure network (but ask for info)\n- CliNetworkHostname\n- CliNetworkIPAddress\n- CliNetworkNetmask\n- CliNetworkGateway\n- SimpOptionsDNSServers\n- SimpOptionsDNSSearch\n- SetHostnameAction\n- SimpOptionsTrustedNets\n- SimpOptionsNTPServers\n\n# ==== General actions and related configuration ====\n- CliSetGrubPassword:\ntrue:\n- GrubPassword\n- SetGrubPasswordAction\n- SimpRunLevel SKIPQUERY SILENT # this is needed for compliance mapping\n\n# ==== Puppet actions and related configuration ====\n- CliSetProductionToSimp:\ntrue:\n- SetProductionToSimpAction\n- SimpOptionsPuppetServer SKIPQUERY SILENT # default is correct\n- CliPuppetServerIP SKIPQUERY SILENT # don't ever prompt, just discover current value\n- SimpOptionsPuppetCA SKIPQUERY SILENT # default is correct\n- SimpOptionsPuppetCAPort SKIPQUERY SILENT # default is correct\n- PuppetDBMasterConfigPuppetDBServer SKIPQUERY SILENT # default is correct\n- PuppetDBMasterConfigPuppetDBPort SKIPQUERY SILENT # default is correct\n- SetUpPuppetAutosignAction\n- UpdatePuppetConfAction\n- AddPuppetHostsEntryAction\n# Move the hieradata/hosts/puppet.your.domain.yaml template to\n# hieradata/hosts/<host>.yaml file (as appropriate) before\n# dealing with any features that modify that file\n- CreateSimpServerFqdnYamlAction\n- SetServerPuppetDBMasterConfigAction\n\n# ==== YUM actions and related configuration ====\n- CliHasLocalYumRepos SKIPQUERY SILENT: # don't ever prompt, just discover current value\ntrue:\n- SimpYumServers SKIPQUERY SILENT # default is correct\n- UpdateOsYumRepositoriesAction\n- AddYumServerClassToServerAction\nfalse:\n- SimpYumServers\n- SimpYumOsUpdateUrl\n- SimpYumSimpUpdateUrl\n- SimpYumEnableOsRepos SKIPQUERY SILENT # default is correct\n- SimpYumEnableSimpRepos SKIPQUERY SILENT # default is correct\n- EnableOsAndSimpYumReposAction\n- CheckRemoteYumConfigAction\n\n# ==== Remaining global catalysts and their actions ===\n- SimpOptionsLdap \#{query_options}: # make sure to query if not set in scenario\ntrue:\n- SimpOptionsSSSD SKIPQUERY SILENT # default is correct\n- SssdDomains SKIPQUERY SILENT # default is correct\n- CliIsLdapServer:\ntrue:\n- SimpOptionsLdapBaseDn SKIPQUERY SILENT # default is correct\n- SimpOptionsLdapBindPw GENERATENOQUERY SILENT # automatically generate\n- SimpOptionsLdapBindHash SILENT # never queries\n- SimpOptionsLdapSyncPw GENERATENOQUERY SILENT # automatically generate\n- SimpOptionsLdapSyncHash SILENT # never queries\n- SimpOpenldapServerConfRootpw\n- AddLdapServerClassToServerAction\n- SetServerLdapServerConfigAction\nfalse:\n- SimpOptionsLdapBaseDn\n- SimpOptionsLdapBindDn\n- SimpOptionsLdapBindPw NEVERGENERATE\n- SimpOptionsLdapBindHash SILENT #never queries\n- SimpOptionsLdapSyncDn\n- SimpOptionsLdapSyncPw NEVERGENERATE\n- SimpOptionsLdapSyncHash SILENT # never queries\n- SimpOptionsLdapMaster\n- SimpOptionsLdapUri\nfalse:\n- SimpOptionsSSSD:\ntrue:\n- SssdDomains\n- SimpOptionsSyslogLogServers\n- CliLogServersSpecified SKIPQUERY SILENT: # don't ever prompt, just discover current value\ntrue:\n- SimpOptionsSyslogFailoverLogServers\n- GenerateCertificatesAction # needed for SIMP server independent of scenario\n\n# ==== Writers ====\n- HieradataYAMLFileWriter FILE=\#{ @options.fetch( :puppet_system_file, '/dev/null') }\n# This is the ONLY action that can be run as non-root user, as all it\n# does is create a file that is not within the Puppet environment.\n- AnswersYAMLFileWriter FILE=\#{ @options.fetch( :answers_output_file, '/dev/null') } USERAPPLY DRYRUNAPPLY\n".gsub(/^ {6}/,'')
end