├── .gitignore ├── .testseries ├── CHANGELOG ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── Rakefile ├── acceptance ├── pending │ ├── ticket_3360_reject_duplicate_csr_with_option_unset.rb │ ├── ticket_4149_parseonly_should_not_fail.rb │ ├── ticket_4151_defined_function_should_not_return_true_for_unrealized_virtual_resources.rb │ ├── ticket_5027_warn_on_dynamic_scope.rb │ ├── ticket_6710_relationship_syntax_should_work_with_title_arrays.rb │ └── ticket_6928_puppet_master_parse_fails.rb └── tests │ ├── allow_arbitrary_node_name_fact_for_agent.rb │ ├── allow_arbitrary_node_name_fact_for_apply.rb │ ├── allow_arbitrary_node_name_for_agent.rb │ ├── allow_arbitrary_node_name_for_apply.rb │ ├── allow_symlinks_as_config_directories.rb │ ├── apply │ ├── classes │ │ ├── parameterized_classes.rb │ │ ├── should_allow_param_override.rb │ │ ├── should_allow_param_undef_override.rb │ │ ├── should_include_resources_from_class.rb │ │ └── should_not_auto_include_resources_from_class.rb │ ├── conditionals │ │ ├── should_evaluate_else.rb │ │ ├── should_evaluate_elsif.rb │ │ ├── should_evaluate_empty.rb │ │ ├── should_evaluate_false.rb │ │ ├── should_evaluate_if.rb │ │ ├── should_evaluate_strings_true.rb │ │ └── should_evaluate_undef.rb │ ├── hashes │ │ └── should_not_reassign.rb │ └── virtual │ │ ├── should_realize.rb │ │ ├── should_realize_complex_query.rb │ │ ├── should_realize_many.rb │ │ ├── should_realize_query.rb │ │ └── should_realize_query_array.rb │ ├── doc │ ├── should_print_function_reference.rb │ └── ticket_4120_cannot_generate_type_reference.rb │ ├── file_hello_world.rb │ ├── helpful_error_message_when_hostname_not_match_server_certificate.rb │ ├── jeff_append_to_array.rb │ ├── key_compare_puppet_conf_configprint.rb │ ├── language │ └── resource_refs_with_nested_arrays.rb │ ├── puppet_apply_a_file_should_create_a_file_and_report_the_md5.rb │ ├── puppet_apply_basics.rb │ ├── puppet_apply_should_show_a_notice.rb │ ├── puppet_master_help_should_mention_puppet_master.rb │ ├── resource │ ├── cron │ │ ├── should_create_cron.rb │ │ ├── should_match_existing.rb │ │ ├── should_remove_cron.rb │ │ ├── should_remove_matching.rb │ │ └── should_update_existing.rb │ ├── exec │ │ ├── should_not_run_command_creates.rb │ │ ├── should_run_command.rb │ │ └── should_set_path.rb │ ├── file │ │ ├── content_attribute.rb │ │ ├── should_create_directory.rb │ │ ├── should_create_empty.rb │ │ ├── should_create_symlink.rb │ │ ├── should_remove_dir.rb │ │ ├── should_remove_file.rb │ │ ├── source_attribtute.rb │ │ └── ticket_8740_should_not_enumerate_root_directory.rb │ ├── group │ │ ├── should_create.rb │ │ ├── should_destroy.rb │ │ ├── should_modify_gid.rb │ │ ├── should_not_create_existing.rb │ │ ├── should_not_destoy_unexisting.rb │ │ ├── should_query.rb │ │ └── should_query_all.rb │ ├── host │ │ ├── should_create.rb │ │ ├── should_create_aliases.rb │ │ ├── should_destroy.rb │ │ ├── should_modify_alias.rb │ │ ├── should_modify_ip.rb │ │ ├── should_not_create_existing.rb │ │ ├── should_query.rb │ │ ├── should_query_all.rb │ │ └── ticket_4131_should_not_create_without_ip.rb │ ├── service │ │ ├── ticket_4123_should_list_all_running_redhat.rb │ │ ├── ticket_4123_should_list_all_running_redhat.sh │ │ ├── ticket_4124_should_list_all_disabled.rb │ │ └── ticket_4124_should_list_all_disabled.sh │ └── user │ │ ├── should_create.rb │ │ ├── should_create_with_gid.rb │ │ ├── should_destroy.rb │ │ ├── should_modify_gid.rb │ │ ├── should_not_create_existing.rb │ │ ├── should_not_destoy_unexisting.rb │ │ ├── should_query.rb │ │ └── should_query_all.rb │ ├── stages │ └── ticket_4655_default_stage_for_classes.rb │ ├── ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb │ ├── ticket_3360_allow_duplicate_csr_with_option_set.rb │ ├── ticket_3656_requiring_multiple_resources.rb │ ├── ticket_3961_puppet_ca_should_produce_certs.rb │ ├── ticket_4059_ralsh_can_change_settings.rb │ ├── ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb │ ├── ticket_4233_resource_with_a_newline.rb │ ├── ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb │ ├── ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb │ ├── ticket_4289_facter_should_recognize_OEL_operatingsystemrelease.rb │ ├── ticket_4293_define_and_use_a_define_within_a_class.rb │ ├── ticket_4404_should_allow_stage_main_on_left_side_of_relationship.rb │ ├── ticket_4423_cannot_declare_two_parameterized_classes.rb │ ├── ticket_5027_warn_on_dynamic_scope.rb │ ├── ticket_5477_master_not_dectect_sitepp.rb │ ├── ticket_6418_file_recursion_and_audit.rb │ ├── ticket_6541_invalid_filebucket_files.rb │ ├── ticket_6734_6256_5530_5503.rb │ ├── ticket_6857_password-disclosure-when-changing-a-users-password.rb │ ├── ticket_6928_puppet_master_parse_fails.rb │ ├── ticket_7101_template_compile.rb │ ├── ticket_7117_broke_env_criteria_authconf.rb │ ├── ticket_7139_puppet_resource_file_qualified_paths.rb │ └── ticket_7728_don't_log_whits_on_failure.rb ├── autotest ├── README.markdown ├── discover.rb ├── images │ ├── fail.png │ ├── pass.png │ └── pending.png ├── puppet_rspec.rb └── rspec.rb ├── bin ├── filebucket ├── pi ├── puppet ├── puppetdoc └── ralsh ├── conf ├── auth.conf ├── epm.list ├── freebsd │ ├── puppetd │ └── puppetmasterd ├── gentoo │ ├── conf.d │ │ ├── puppet │ │ └── puppetmaster │ ├── init.d │ │ ├── puppet │ │ └── puppetmaster │ └── puppet │ │ ├── fileserver.conf │ │ └── puppet.conf ├── namespaceauth.conf ├── osx │ ├── PackageInfo.plist │ ├── createpackage.sh │ └── preflight ├── puppet-queue.conf ├── redhat │ ├── client.init │ ├── client.sysconfig │ ├── fileserver.conf │ ├── logrotate │ ├── puppet.conf │ ├── puppet.spec │ ├── rundir-perms.patch │ ├── server.init │ └── server.sysconfig ├── solaris │ ├── pkginfo │ └── smf │ │ ├── puppetd.xml │ │ ├── puppetmasterd.xml │ │ ├── svc-puppetd │ │ └── svc-puppetmasterd └── suse │ ├── client.init │ ├── fileserver.conf │ ├── logrotate │ ├── puppet.conf │ ├── puppet.spec │ └── server.init ├── examples ├── allatonce ├── assignments ├── components ├── etc │ ├── init.d │ │ └── sleeper │ ├── otherfile │ └── puppet │ │ ├── fileserver.conf │ │ ├── namespaceauth.conf │ │ ├── puppet.conf │ │ └── tagmail.conf ├── execs ├── file.bl ├── filedefaults ├── fileparsing ├── filerecursion ├── functions ├── groups ├── head ├── importing ├── mac_automount.pp ├── mac_dscl.pp ├── mac_dscl_revert.pp ├── mac_pkgdmg.pp ├── mcx_dock_absent.pp ├── mcx_dock_default.pp ├── mcx_dock_full.pp ├── mcx_dock_invalid.pp ├── mcx_nogroup.pp ├── mcx_notexists_absent.pp ├── modules │ ├── sample-module.pp │ └── sample-module │ │ ├── README.txt │ │ ├── lib │ │ └── puppet │ │ │ └── parser │ │ │ └── functions │ │ │ └── hostname_to_dn.rb │ │ ├── manifests │ │ └── init.pp │ │ └── templates │ │ └── sample.erb ├── nodes ├── one ├── relationships ├── selectors ├── simpletests └── svncommit ├── ext ├── autotest │ ├── Rakefile │ ├── config │ └── readme.rst ├── cert_inspector ├── dbfix.sql ├── emacs │ ├── puppet-mode-init.el │ └── puppet-mode.el ├── envpuppet ├── ldap │ └── puppet.schema ├── logcheck │ └── puppet ├── nagios │ ├── check_puppet.rb │ └── naggen ├── puppet-load.rb ├── puppet-test ├── puppetlisten │ ├── puppetlisten.rb │ └── puppetrun.rb ├── puppetstoredconfigclean.rb ├── pure_ruby_dsl │ └── dsl_test.rb ├── rack │ ├── README │ ├── files │ │ ├── apache2.conf │ │ └── config.ru │ └── manifest.pp ├── regexp_nodes │ ├── classes │ │ ├── databases │ │ └── webservers │ ├── parameters │ │ └── environment │ │ │ ├── prod │ │ │ └── qa │ └── regexp_nodes.rb ├── vim │ ├── README │ ├── ftdetect │ │ └── puppet.vim │ ├── ftplugin │ │ └── puppet.vim │ ├── indent │ │ └── puppet.vim │ └── syntax │ │ └── puppet.vim └── yaml_nodes.rb ├── install.rb ├── lib ├── puppet.rb ├── puppet │ ├── agent.rb │ ├── agent │ │ └── locker.rb │ ├── application.rb │ ├── application │ │ ├── agent.rb │ │ ├── apply.rb │ │ ├── ca.rb │ │ ├── catalog.rb │ │ ├── cert.rb │ │ ├── certificate.rb │ │ ├── certificate_request.rb │ │ ├── certificate_revocation_list.rb │ │ ├── config.rb │ │ ├── describe.rb │ │ ├── device.rb │ │ ├── doc.rb │ │ ├── face_base.rb │ │ ├── facts.rb │ │ ├── file.rb │ │ ├── filebucket.rb │ │ ├── help.rb │ │ ├── indirection_base.rb │ │ ├── inspect.rb │ │ ├── key.rb │ │ ├── kick.rb │ │ ├── man.rb │ │ ├── master.rb │ │ ├── node.rb │ │ ├── parser.rb │ │ ├── plugin.rb │ │ ├── queue.rb │ │ ├── report.rb │ │ ├── resource.rb │ │ ├── resource_type.rb │ │ ├── secret_agent.rb │ │ └── status.rb │ ├── configurer.rb │ ├── configurer │ │ ├── downloader.rb │ │ ├── fact_handler.rb │ │ └── plugin_handler.rb │ ├── daemon.rb │ ├── defaults.rb │ ├── dsl.rb │ ├── dsl │ │ ├── resource_api.rb │ │ └── resource_type_api.rb │ ├── error.rb │ ├── external │ │ ├── base64.rb │ │ ├── dot.rb │ │ ├── event-loop.rb │ │ ├── event-loop │ │ │ ├── better-definers.rb │ │ │ ├── event-loop.rb │ │ │ └── signal-system.rb │ │ ├── lock.rb │ │ ├── nagios.rb │ │ ├── nagios │ │ │ ├── base.rb │ │ │ ├── grammar.ry │ │ │ ├── makefile │ │ │ └── parser.rb │ │ └── pson │ │ │ ├── common.rb │ │ │ ├── pure.rb │ │ │ ├── pure │ │ │ ├── generator.rb │ │ │ └── parser.rb │ │ │ └── version.rb │ ├── face.rb │ ├── face │ │ ├── ca.rb │ │ ├── catalog.rb │ │ ├── catalog │ │ │ └── select.rb │ │ ├── certificate.rb │ │ ├── certificate_request.rb │ │ ├── certificate_revocation_list.rb │ │ ├── config.rb │ │ ├── facts.rb │ │ ├── file.rb │ │ ├── file │ │ │ ├── download.rb │ │ │ └── store.rb │ │ ├── help.rb │ │ ├── help │ │ │ ├── action.erb │ │ │ ├── face.erb │ │ │ ├── global.erb │ │ │ └── man.erb │ │ ├── key.rb │ │ ├── man.rb │ │ ├── node.rb │ │ ├── node │ │ │ └── clean.rb │ │ ├── parser.rb │ │ ├── plugin.rb │ │ ├── report.rb │ │ ├── resource.rb │ │ ├── resource_type.rb │ │ ├── secret_agent.rb │ │ └── status.rb │ ├── feature │ │ ├── base.rb │ │ ├── pson.rb │ │ ├── rack.rb │ │ ├── rails.rb │ │ ├── rubygems.rb │ │ ├── selinux.rb │ │ ├── ssh.rb │ │ ├── stomp.rb │ │ └── zlib.rb │ ├── file_bucket.rb │ ├── file_bucket │ │ ├── dipper.rb │ │ ├── file.rb │ │ └── file │ │ │ └── indirection_hooks.rb │ ├── file_collection.rb │ ├── file_collection │ │ └── lookup.rb │ ├── file_serving.rb │ ├── file_serving │ │ ├── base.rb │ │ ├── configuration.rb │ │ ├── configuration │ │ │ └── parser.rb │ │ ├── content.rb │ │ ├── fileset.rb │ │ ├── indirection_hooks.rb │ │ ├── metadata.rb │ │ ├── mount.rb │ │ ├── mount │ │ │ ├── file.rb │ │ │ ├── modules.rb │ │ │ └── plugins.rb │ │ └── terminus_helper.rb │ ├── indirector.rb │ ├── indirector │ │ ├── active_record.rb │ │ ├── catalog │ │ │ ├── active_record.rb │ │ │ ├── compiler.rb │ │ │ ├── queue.rb │ │ │ ├── rest.rb │ │ │ ├── static_compiler.rb │ │ │ ├── store_configs.rb │ │ │ └── yaml.rb │ │ ├── certificate │ │ │ ├── ca.rb │ │ │ ├── file.rb │ │ │ └── rest.rb │ │ ├── certificate_request │ │ │ ├── ca.rb │ │ │ ├── file.rb │ │ │ └── rest.rb │ │ ├── certificate_revocation_list │ │ │ ├── ca.rb │ │ │ ├── file.rb │ │ │ └── rest.rb │ │ ├── certificate_status.rb │ │ ├── certificate_status │ │ │ ├── file.rb │ │ │ └── rest.rb │ │ ├── code.rb │ │ ├── couch.rb │ │ ├── direct_file_server.rb │ │ ├── envelope.rb │ │ ├── exec.rb │ │ ├── face.rb │ │ ├── facts │ │ │ ├── active_record.rb │ │ │ ├── couch.rb │ │ │ ├── facter.rb │ │ │ ├── inventory_active_record.rb │ │ │ ├── memory.rb │ │ │ ├── network_device.rb │ │ │ ├── rest.rb │ │ │ ├── store_configs.rb │ │ │ └── yaml.rb │ │ ├── file.rb │ │ ├── file_bucket_file │ │ │ ├── file.rb │ │ │ └── rest.rb │ │ ├── file_content.rb │ │ ├── file_content │ │ │ ├── file.rb │ │ │ ├── file_server.rb │ │ │ └── rest.rb │ │ ├── file_metadata.rb │ │ ├── file_metadata │ │ │ ├── file.rb │ │ │ ├── file_server.rb │ │ │ └── rest.rb │ │ ├── file_server.rb │ │ ├── indirection.rb │ │ ├── inventory │ │ │ └── yaml.rb │ │ ├── key │ │ │ ├── ca.rb │ │ │ └── file.rb │ │ ├── ldap.rb │ │ ├── memory.rb │ │ ├── node │ │ │ ├── active_record.rb │ │ │ ├── exec.rb │ │ │ ├── ldap.rb │ │ │ ├── memory.rb │ │ │ ├── plain.rb │ │ │ ├── rest.rb │ │ │ ├── store_configs.rb │ │ │ └── yaml.rb │ │ ├── plain.rb │ │ ├── queue.rb │ │ ├── report │ │ │ ├── processor.rb │ │ │ ├── rest.rb │ │ │ └── yaml.rb │ │ ├── request.rb │ │ ├── resource │ │ │ ├── active_record.rb │ │ │ ├── ral.rb │ │ │ ├── rest.rb │ │ │ └── store_configs.rb │ │ ├── resource_type.rb │ │ ├── resource_type │ │ │ ├── parser.rb │ │ │ └── rest.rb │ │ ├── rest.rb │ │ ├── run │ │ │ ├── local.rb │ │ │ └── rest.rb │ │ ├── ssl_file.rb │ │ ├── status.rb │ │ ├── status │ │ │ ├── local.rb │ │ │ └── rest.rb │ │ ├── store_configs.rb │ │ ├── terminus.rb │ │ └── yaml.rb │ ├── interface.rb │ ├── interface │ │ ├── action.rb │ │ ├── action_builder.rb │ │ ├── action_manager.rb │ │ ├── documentation.rb │ │ ├── face_collection.rb │ │ ├── option.rb │ │ ├── option_builder.rb │ │ └── option_manager.rb │ ├── metatype │ │ └── manager.rb │ ├── module.rb │ ├── network.rb │ ├── network │ │ ├── authconfig.rb │ │ ├── authorization.rb │ │ ├── authstore.rb │ │ ├── client.rb │ │ ├── client │ │ │ ├── ca.rb │ │ │ ├── file.rb │ │ │ ├── proxy.rb │ │ │ ├── report.rb │ │ │ ├── runner.rb │ │ │ └── status.rb │ │ ├── client_request.rb │ │ ├── format.rb │ │ ├── format_handler.rb │ │ ├── formats.rb │ │ ├── handler.rb │ │ ├── handler │ │ │ ├── ca.rb │ │ │ ├── filebucket.rb │ │ │ ├── fileserver.rb │ │ │ ├── master.rb │ │ │ ├── report.rb │ │ │ ├── runner.rb │ │ │ └── status.rb │ │ ├── http.rb │ │ ├── http │ │ │ ├── api.rb │ │ │ ├── api │ │ │ │ └── v1.rb │ │ │ ├── compression.rb │ │ │ ├── handler.rb │ │ │ ├── mongrel.rb │ │ │ ├── mongrel │ │ │ │ └── rest.rb │ │ │ ├── rack.rb │ │ │ ├── rack │ │ │ │ ├── httphandler.rb │ │ │ │ ├── rest.rb │ │ │ │ └── xmlrpc.rb │ │ │ ├── webrick.rb │ │ │ └── webrick │ │ │ │ └── rest.rb │ │ ├── http_pool.rb │ │ ├── http_server.rb │ │ ├── http_server │ │ │ ├── mongrel.rb │ │ │ └── webrick.rb │ │ ├── rest_authconfig.rb │ │ ├── rest_authorization.rb │ │ ├── rest_controller.rb │ │ ├── rights.rb │ │ ├── server.rb │ │ └── xmlrpc │ │ │ ├── client.rb │ │ │ ├── processor.rb │ │ │ ├── server.rb │ │ │ └── webrick_servlet.rb │ ├── node.rb │ ├── node │ │ ├── environment.rb │ │ ├── facts.rb │ │ └── inventory.rb │ ├── parameter.rb │ ├── parameter │ │ ├── path.rb │ │ ├── value.rb │ │ └── value_collection.rb │ ├── parser.rb │ ├── parser │ │ ├── ast.rb │ │ ├── ast │ │ │ ├── arithmetic_operator.rb │ │ │ ├── astarray.rb │ │ │ ├── asthash.rb │ │ │ ├── boolean_operator.rb │ │ │ ├── branch.rb │ │ │ ├── caseopt.rb │ │ │ ├── casestatement.rb │ │ │ ├── collection.rb │ │ │ ├── collexpr.rb │ │ │ ├── comparison_operator.rb │ │ │ ├── definition.rb │ │ │ ├── else.rb │ │ │ ├── function.rb │ │ │ ├── hostclass.rb │ │ │ ├── ifstatement.rb │ │ │ ├── in_operator.rb │ │ │ ├── leaf.rb │ │ │ ├── match_operator.rb │ │ │ ├── minus.rb │ │ │ ├── node.rb │ │ │ ├── nop.rb │ │ │ ├── not.rb │ │ │ ├── relationship.rb │ │ │ ├── resource.rb │ │ │ ├── resource_defaults.rb │ │ │ ├── resource_instance.rb │ │ │ ├── resource_override.rb │ │ │ ├── resource_reference.rb │ │ │ ├── resourceparam.rb │ │ │ ├── selector.rb │ │ │ ├── tag.rb │ │ │ ├── top_level_construct.rb │ │ │ └── vardef.rb │ │ ├── collector.rb │ │ ├── compiler.rb │ │ ├── files.rb │ │ ├── functions.rb │ │ ├── functions │ │ │ ├── create_resources.rb │ │ │ ├── defined.rb │ │ │ ├── extlookup.rb │ │ │ ├── fail.rb │ │ │ ├── file.rb │ │ │ ├── fqdn_rand.rb │ │ │ ├── generate.rb │ │ │ ├── include.rb │ │ │ ├── inline_template.rb │ │ │ ├── md5.rb │ │ │ ├── realize.rb │ │ │ ├── regsubst.rb │ │ │ ├── require.rb │ │ │ ├── search.rb │ │ │ ├── sha1.rb │ │ │ ├── shellquote.rb │ │ │ ├── split.rb │ │ │ ├── sprintf.rb │ │ │ ├── tag.rb │ │ │ ├── tagged.rb │ │ │ ├── template.rb │ │ │ └── versioncmp.rb │ │ ├── grammar.ra │ │ ├── lexer.rb │ │ ├── makefile │ │ ├── parser.rb │ │ ├── parser_support.rb │ │ ├── relationship.rb │ │ ├── resource.rb │ │ ├── resource │ │ │ └── param.rb │ │ ├── scope.rb │ │ ├── templatewrapper.rb │ │ ├── type_loader.rb │ │ └── yaml_trimmer.rb │ ├── property.rb │ ├── property │ │ ├── ensure.rb │ │ ├── keyvalue.rb │ │ ├── list.rb │ │ └── ordered_list.rb │ ├── provider.rb │ ├── provider │ │ ├── aixobject.rb │ │ ├── augeas │ │ │ └── augeas.rb │ │ ├── cisco.rb │ │ ├── computer │ │ │ └── computer.rb │ │ ├── confine.rb │ │ ├── confine │ │ │ ├── exists.rb │ │ │ ├── false.rb │ │ │ ├── feature.rb │ │ │ ├── true.rb │ │ │ └── variable.rb │ │ ├── confine_collection.rb │ │ ├── confiner.rb │ │ ├── cron │ │ │ └── crontab.rb │ │ ├── exec.rb │ │ ├── exec │ │ │ ├── posix.rb │ │ │ ├── shell.rb │ │ │ └── windows.rb │ │ ├── file │ │ │ ├── posix.rb │ │ │ └── win32.rb │ │ ├── group │ │ │ ├── aix.rb │ │ │ ├── directoryservice.rb │ │ │ ├── groupadd.rb │ │ │ ├── ldap.rb │ │ │ ├── pw.rb │ │ │ └── windows_adsi.rb │ │ ├── host │ │ │ └── parsed.rb │ │ ├── interface │ │ │ ├── base.rb │ │ │ └── cisco.rb │ │ ├── ldap.rb │ │ ├── macauthorization │ │ │ └── macauthorization.rb │ │ ├── mailalias │ │ │ └── aliases.rb │ │ ├── maillist │ │ │ └── mailman.rb │ │ ├── mcx │ │ │ └── mcxcontent.rb │ │ ├── mount.rb │ │ ├── mount │ │ │ └── parsed.rb │ │ ├── naginator.rb │ │ ├── nameservice.rb │ │ ├── nameservice │ │ │ ├── directoryservice.rb │ │ │ ├── objectadd.rb │ │ │ └── pw.rb │ │ ├── network_device.rb │ │ ├── package.rb │ │ ├── package │ │ │ ├── aix.rb │ │ │ ├── appdmg.rb │ │ │ ├── apple.rb │ │ │ ├── apt.rb │ │ │ ├── aptitude.rb │ │ │ ├── aptrpm.rb │ │ │ ├── blastwave.rb │ │ │ ├── dpkg.rb │ │ │ ├── fink.rb │ │ │ ├── freebsd.rb │ │ │ ├── gem.rb │ │ │ ├── hpux.rb │ │ │ ├── macports.rb │ │ │ ├── msi.rb │ │ │ ├── nim.rb │ │ │ ├── openbsd.rb │ │ │ ├── pacman.rb │ │ │ ├── pip.rb │ │ │ ├── pkg.rb │ │ │ ├── pkgdmg.rb │ │ │ ├── pkgutil.rb │ │ │ ├── portage.rb │ │ │ ├── ports.rb │ │ │ ├── portupgrade.rb │ │ │ ├── rpm.rb │ │ │ ├── rug.rb │ │ │ ├── sun.rb │ │ │ ├── sunfreeware.rb │ │ │ ├── up2date.rb │ │ │ ├── urpmi.rb │ │ │ ├── yum.rb │ │ │ ├── yumhelper.py │ │ │ └── zypper.rb │ │ ├── parsedfile.rb │ │ ├── port │ │ │ └── parsed.rb │ │ ├── selboolean │ │ │ └── getsetsebool.rb │ │ ├── selmodule │ │ │ └── semodule.rb │ │ ├── service │ │ │ ├── base.rb │ │ │ ├── bsd.rb │ │ │ ├── daemontools.rb │ │ │ ├── debian.rb │ │ │ ├── freebsd.rb │ │ │ ├── gentoo.rb │ │ │ ├── init.rb │ │ │ ├── launchd.rb │ │ │ ├── redhat.rb │ │ │ ├── runit.rb │ │ │ ├── smf.rb │ │ │ ├── src.rb │ │ │ ├── systemd.rb │ │ │ ├── upstart.rb │ │ │ └── windows.rb │ │ ├── ssh_authorized_key │ │ │ └── parsed.rb │ │ ├── sshkey │ │ │ └── parsed.rb │ │ ├── user │ │ │ ├── aix.rb │ │ │ ├── directoryservice.rb │ │ │ ├── hpux.rb │ │ │ ├── ldap.rb │ │ │ ├── pw.rb │ │ │ ├── user_role_add.rb │ │ │ ├── useradd.rb │ │ │ └── windows_adsi.rb │ │ ├── vlan │ │ │ └── cisco.rb │ │ ├── zfs │ │ │ └── solaris.rb │ │ ├── zone │ │ │ └── solaris.rb │ │ └── zpool │ │ │ └── solaris.rb │ ├── rails.rb │ ├── rails │ │ ├── benchmark.rb │ │ ├── database │ │ │ ├── 001_add_created_at_to_all_tables.rb │ │ │ ├── 002_remove_duplicated_index_on_all_tables.rb │ │ │ ├── 003_add_environment_to_host.rb │ │ │ ├── 004_add_inventory_service_tables.rb │ │ │ └── schema.rb │ │ ├── fact_name.rb │ │ ├── fact_value.rb │ │ ├── host.rb │ │ ├── inventory_fact.rb │ │ ├── inventory_node.rb │ │ ├── param_name.rb │ │ ├── param_value.rb │ │ ├── puppet_tag.rb │ │ ├── resource.rb │ │ ├── resource_tag.rb │ │ └── source_file.rb │ ├── reference │ │ ├── configuration.rb │ │ ├── function.rb │ │ ├── indirection.rb │ │ ├── metaparameter.rb │ │ ├── network.rb │ │ ├── providers.rb │ │ ├── report.rb │ │ └── type.rb │ ├── relationship.rb │ ├── reports.rb │ ├── reports │ │ ├── http.rb │ │ ├── log.rb │ │ ├── rrdgraph.rb │ │ ├── store.rb │ │ └── tagmail.rb │ ├── resource.rb │ ├── resource │ │ ├── catalog.rb │ │ ├── status.rb │ │ ├── type.rb │ │ ├── type_collection.rb │ │ └── type_collection_helper.rb │ ├── run.rb │ ├── simple_graph.rb │ ├── ssl.rb │ ├── ssl │ │ ├── base.rb │ │ ├── certificate.rb │ │ ├── certificate_authority.rb │ │ ├── certificate_authority │ │ │ └── interface.rb │ │ ├── certificate_factory.rb │ │ ├── certificate_request.rb │ │ ├── certificate_revocation_list.rb │ │ ├── host.rb │ │ ├── inventory.rb │ │ └── key.rb │ ├── sslcertificates.rb │ ├── sslcertificates │ │ ├── ca.rb │ │ ├── certificate.rb │ │ ├── inventory.rb │ │ └── support.rb │ ├── status.rb │ ├── transaction.rb │ ├── transaction │ │ ├── event.rb │ │ ├── event_manager.rb │ │ ├── report.rb │ │ └── resource_harness.rb │ ├── transportable.rb │ ├── type.rb │ ├── type │ │ ├── augeas.rb │ │ ├── component.rb │ │ ├── computer.rb │ │ ├── cron.rb │ │ ├── exec.rb │ │ ├── file.rb │ │ ├── file │ │ │ ├── checksum.rb │ │ │ ├── content.rb │ │ │ ├── ctime.rb │ │ │ ├── ensure.rb │ │ │ ├── group.rb │ │ │ ├── mode.rb │ │ │ ├── mtime.rb │ │ │ ├── owner.rb │ │ │ ├── selcontext.rb │ │ │ ├── source.rb │ │ │ ├── target.rb │ │ │ └── type.rb │ │ ├── filebucket.rb │ │ ├── group.rb │ │ ├── host.rb │ │ ├── interface.rb │ │ ├── k5login.rb │ │ ├── macauthorization.rb │ │ ├── mailalias.rb │ │ ├── maillist.rb │ │ ├── mcx.rb │ │ ├── mount.rb │ │ ├── nagios_command.rb │ │ ├── nagios_contact.rb │ │ ├── nagios_contactgroup.rb │ │ ├── nagios_host.rb │ │ ├── nagios_hostdependency.rb │ │ ├── nagios_hostescalation.rb │ │ ├── nagios_hostextinfo.rb │ │ ├── nagios_hostgroup.rb │ │ ├── nagios_service.rb │ │ ├── nagios_servicedependency.rb │ │ ├── nagios_serviceescalation.rb │ │ ├── nagios_serviceextinfo.rb │ │ ├── nagios_servicegroup.rb │ │ ├── nagios_timeperiod.rb │ │ ├── notify.rb │ │ ├── package.rb │ │ ├── port.rb │ │ ├── resources.rb │ │ ├── router.rb │ │ ├── schedule.rb │ │ ├── selboolean.rb │ │ ├── selmodule.rb │ │ ├── service.rb │ │ ├── ssh_authorized_key.rb │ │ ├── sshkey.rb │ │ ├── stage.rb │ │ ├── tidy.rb │ │ ├── user.rb │ │ ├── vlan.rb │ │ ├── whit.rb │ │ ├── yumrepo.rb │ │ ├── zfs.rb │ │ ├── zone.rb │ │ └── zpool.rb │ ├── util.rb │ └── util │ │ ├── adsi.rb │ │ ├── autoload.rb │ │ ├── autoload │ │ └── file_cache.rb │ │ ├── backups.rb │ │ ├── cacher.rb │ │ ├── checksums.rb │ │ ├── classgen.rb │ │ ├── command_line.rb │ │ ├── constant_inflector.rb │ │ ├── diff.rb │ │ ├── docs.rb │ │ ├── errors.rb │ │ ├── execution.rb │ │ ├── execution_stub.rb │ │ ├── feature.rb │ │ ├── file_locking.rb │ │ ├── fileparsing.rb │ │ ├── filetype.rb │ │ ├── graph.rb │ │ ├── inifile.rb │ │ ├── inline_docs.rb │ │ ├── instance_loader.rb │ │ ├── ldap.rb │ │ ├── ldap │ │ ├── connection.rb │ │ ├── generator.rb │ │ └── manager.rb │ │ ├── loadedfile.rb │ │ ├── log.rb │ │ ├── log │ │ ├── destination.rb │ │ └── destinations.rb │ │ ├── log_paths.rb │ │ ├── logging.rb │ │ ├── metaid.rb │ │ ├── methodhelper.rb │ │ ├── metric.rb │ │ ├── monkey_patches.rb │ │ ├── nagios_maker.rb │ │ ├── network_device.rb │ │ ├── network_device │ │ ├── base.rb │ │ ├── cisco.rb │ │ ├── cisco │ │ │ ├── device.rb │ │ │ ├── facts.rb │ │ │ └── interface.rb │ │ ├── config.rb │ │ ├── ipcalc.rb │ │ ├── transport.rb │ │ └── transport │ │ │ ├── base.rb │ │ │ ├── ssh.rb │ │ │ └── telnet.rb │ │ ├── package.rb │ │ ├── pidlock.rb │ │ ├── plugins.rb │ │ ├── posix.rb │ │ ├── provider_features.rb │ │ ├── pson.rb │ │ ├── queue.rb │ │ ├── queue │ │ └── stomp.rb │ │ ├── rails │ │ ├── cache_accumulator.rb │ │ ├── collection_merger.rb │ │ └── reference_serializer.rb │ │ ├── rdoc.rb │ │ ├── rdoc │ │ ├── code_objects.rb │ │ ├── generators │ │ │ ├── puppet_generator.rb │ │ │ └── template │ │ │ │ └── puppet │ │ │ │ └── puppet.rb │ │ └── parser.rb │ │ ├── reference.rb │ │ ├── resource_template.rb │ │ ├── run_mode.rb │ │ ├── selinux.rb │ │ ├── settings.rb │ │ ├── settings │ │ ├── boolean_setting.rb │ │ ├── file_setting.rb │ │ └── setting.rb │ │ ├── storage.rb │ │ ├── subclass_loader.rb │ │ ├── suidmanager.rb │ │ ├── tagging.rb │ │ ├── user_attr.rb │ │ ├── warnings.rb │ │ └── zaml.rb └── semver.rb ├── man ├── man5 │ └── puppet.conf.5 └── man8 │ ├── filebucket.8 │ ├── pi.8 │ ├── puppet-agent.8 │ ├── puppet-apply.8 │ ├── puppet-catalog.8 │ ├── puppet-cert.8 │ ├── puppet-certificate.8 │ ├── puppet-certificate_request.8 │ ├── puppet-certificate_revocation_list.8 │ ├── puppet-config.8 │ ├── puppet-describe.8 │ ├── puppet-device.8 │ ├── puppet-doc.8 │ ├── puppet-facts.8 │ ├── puppet-file.8 │ ├── puppet-filebucket.8 │ ├── puppet-help.8 │ ├── puppet-inspect.8 │ ├── puppet-key.8 │ ├── puppet-kick.8 │ ├── puppet-man.8 │ ├── puppet-master.8 │ ├── puppet-node.8 │ ├── puppet-parser.8 │ ├── puppet-plugin.8 │ ├── puppet-queue.8 │ ├── puppet-report.8 │ ├── puppet-resource.8 │ ├── puppet-resource_type.8 │ ├── puppet-secret_agent.8 │ ├── puppet-status.8 │ ├── puppet.8 │ ├── puppetca.8 │ ├── puppetd.8 │ ├── puppetdoc.8 │ ├── puppetmasterd.8 │ ├── puppetqd.8 │ ├── puppetrun.8 │ └── ralsh.8 ├── sbin ├── puppetca ├── puppetd ├── puppetmasterd ├── puppetqd └── puppetrun ├── spec ├── fixtures │ ├── faulty_face │ │ └── puppet │ │ │ └── face │ │ │ └── syntax.rb │ ├── integration │ │ └── provider │ │ │ └── mailalias │ │ │ └── aliases │ │ │ └── test1 │ ├── unit │ │ ├── parser │ │ │ └── lexer │ │ │ │ ├── aliastest.pp │ │ │ │ ├── append.pp │ │ │ │ ├── argumentdefaults.pp │ │ │ │ ├── arithmetic_expression.pp │ │ │ │ ├── arraytrailingcomma.pp │ │ │ │ ├── casestatement.pp │ │ │ │ ├── classheirarchy.pp │ │ │ │ ├── classincludes.pp │ │ │ │ ├── classpathtest.pp │ │ │ │ ├── collection.pp │ │ │ │ ├── collection_override.pp │ │ │ │ ├── collection_within_virtual_definitions.pp │ │ │ │ ├── componentmetaparams.pp │ │ │ │ ├── componentrequire.pp │ │ │ │ ├── deepclassheirarchy.pp │ │ │ │ ├── defineoverrides.pp │ │ │ │ ├── emptyclass.pp │ │ │ │ ├── emptyexec.pp │ │ │ │ ├── emptyifelse.pp │ │ │ │ ├── falsevalues.pp │ │ │ │ ├── filecreate.pp │ │ │ │ ├── fqdefinition.pp │ │ │ │ ├── fqparents.pp │ │ │ │ ├── funccomma.pp │ │ │ │ ├── hash.pp │ │ │ │ ├── ifexpression.pp │ │ │ │ ├── implicititeration.pp │ │ │ │ ├── multilinecomments.pp │ │ │ │ ├── multipleclass.pp │ │ │ │ ├── multipleinstances.pp │ │ │ │ ├── multisubs.pp │ │ │ │ ├── namevartest.pp │ │ │ │ ├── scopetest.pp │ │ │ │ ├── selectorvalues.pp │ │ │ │ ├── simpledefaults.pp │ │ │ │ ├── simpleselector.pp │ │ │ │ ├── singleary.pp │ │ │ │ ├── singlequote.pp │ │ │ │ ├── singleselector.pp │ │ │ │ ├── subclass_name_duplication.pp │ │ │ │ ├── tag.pp │ │ │ │ ├── tagged.pp │ │ │ │ └── virtualresources.pp │ │ ├── provider │ │ │ ├── host │ │ │ │ └── parsed │ │ │ │ │ └── valid_hosts │ │ │ ├── mount │ │ │ │ ├── mount-output.aix.txt │ │ │ │ └── parsed │ │ │ │ │ ├── aix.filesystems │ │ │ │ │ ├── aix.mount │ │ │ │ │ ├── darwin.mount │ │ │ │ │ ├── freebsd.fstab │ │ │ │ │ ├── freebsd.mount │ │ │ │ │ ├── hpux.mount │ │ │ │ │ ├── linux.fstab │ │ │ │ │ ├── linux.mount │ │ │ │ │ ├── netbsd.fstab │ │ │ │ │ ├── netbsd.mount │ │ │ │ │ ├── openbsd.fstab │ │ │ │ │ ├── openbsd.mount │ │ │ │ │ ├── solaris.fstab │ │ │ │ │ └── solaris.mount │ │ │ └── ssh_authorized_key │ │ │ │ └── parsed │ │ │ │ ├── authorized_keys │ │ │ │ ├── authorized_keys1 │ │ │ │ └── authorized_keys2 │ │ ├── reports │ │ │ └── tagmail │ │ │ │ ├── tagmail_failers.conf │ │ │ │ └── tagmail_passers.conf │ │ └── util │ │ │ └── rdoc │ │ │ └── basic.pp │ └── yaml │ │ ├── report0.25.x.yaml │ │ ├── report2.6.x.yaml │ │ └── test.local.yaml ├── integration │ ├── application │ │ ├── apply_spec.rb │ │ └── doc_spec.rb │ ├── configurer_spec.rb │ ├── defaults_spec.rb │ ├── faces │ │ └── documentation_spec.rb │ ├── file_serving │ │ ├── content_spec.rb │ │ ├── fileset_spec.rb │ │ ├── metadata_spec.rb │ │ └── terminus_helper_spec.rb │ ├── indirector │ │ ├── catalog │ │ │ ├── compiler_spec.rb │ │ │ └── queue_spec.rb │ │ ├── direct_file_server_spec.rb │ │ ├── file_content │ │ │ └── file_server_spec.rb │ │ ├── file_metadata │ │ │ └── file_server_spec.rb │ │ └── node │ │ │ └── ldap_spec.rb │ ├── network │ │ ├── client_spec.rb │ │ ├── formats_spec.rb │ │ ├── handler_spec.rb │ │ ├── rest_authconfig_spec.rb │ │ └── server │ │ │ ├── mongrel_spec.rb │ │ │ └── webrick_spec.rb │ ├── node │ │ ├── environment_spec.rb │ │ └── facts_spec.rb │ ├── node_spec.rb │ ├── parser │ │ ├── collector_spec.rb │ │ ├── compiler_spec.rb │ │ ├── functions │ │ │ └── require_spec.rb │ │ ├── functions_spec.rb │ │ ├── parser_spec.rb │ │ └── ruby_manifest_spec.rb │ ├── provider │ │ ├── mailalias │ │ │ └── aliases_spec.rb │ │ ├── mount_spec.rb │ │ ├── package_spec.rb │ │ ├── service │ │ │ └── init_spec.rb │ │ └── ssh_authorized_key_spec.rb │ ├── reference │ │ └── providers_spec.rb │ ├── reports_spec.rb │ ├── resource │ │ ├── catalog_spec.rb │ │ └── type_collection_spec.rb │ ├── ssl │ │ ├── certificate_authority_spec.rb │ │ ├── certificate_request_spec.rb │ │ ├── certificate_revocation_list_spec.rb │ │ └── host_spec.rb │ ├── transaction │ │ └── report_spec.rb │ ├── transaction_spec.rb │ ├── type │ │ ├── file_spec.rb │ │ ├── package_spec.rb │ │ └── tidy_spec.rb │ ├── type_spec.rb │ ├── util │ │ ├── autoload_spec.rb │ │ ├── feature_spec.rb │ │ ├── file_locking_spec.rb │ │ ├── rdoc │ │ │ └── parser_spec.rb │ │ └── settings_spec.rb │ └── util_spec.rb ├── lib │ ├── matchers │ │ └── json.rb │ ├── puppet │ │ └── face │ │ │ ├── 1.0.0 │ │ │ └── huzzah.rb │ │ │ ├── basetest.rb │ │ │ ├── huzzah.rb │ │ │ ├── huzzah │ │ │ └── obsolete.rb │ │ │ └── version_matching.rb │ └── puppet_spec │ │ ├── files.rb │ │ ├── fixtures.rb │ │ ├── matchers.rb │ │ └── verbose.rb ├── monkey_patches │ ├── alias_should_to_must.rb │ └── publicize_methods.rb ├── shared_behaviours │ ├── all_parsedfile_providers.rb │ ├── an_indirector_face.rb │ ├── documentation_on_faces.rb │ ├── file_server_terminus.rb │ ├── file_serving.rb │ ├── memory_terminus.rb │ ├── path_parameters.rb │ ├── store_configs_terminus.rb │ └── things_that_declare_options.rb ├── spec.opts ├── spec_helper.rb ├── unit │ ├── agent │ │ └── locker_spec.rb │ ├── agent_spec.rb │ ├── application │ │ ├── agent_spec.rb │ │ ├── apply_spec.rb │ │ ├── cert_spec.rb │ │ ├── certificate_spec.rb │ │ ├── config_spec.rb │ │ ├── describe_spec.rb │ │ ├── device_spec.rb │ │ ├── doc_spec.rb │ │ ├── face_base_spec.rb │ │ ├── facts_spec.rb │ │ ├── filebucket_spec.rb │ │ ├── indirection_base_spec.rb │ │ ├── inspect_spec.rb │ │ ├── kick_spec.rb │ │ ├── master_spec.rb │ │ ├── queue_spec.rb │ │ ├── resource_spec.rb │ │ └── secret_agent_spec.rb │ ├── application_spec.rb │ ├── configurer │ │ ├── downloader_spec.rb │ │ ├── fact_handler_spec.rb │ │ └── plugin_handler_spec.rb │ ├── configurer_spec.rb │ ├── daemon_spec.rb │ ├── dsl │ │ ├── resource_api_spec.rb │ │ └── resource_type_api_spec.rb │ ├── face │ │ ├── ca_spec.rb │ │ ├── catalog_spec.rb │ │ ├── certificate_request_spec.rb │ │ ├── certificate_revocation_list_spec.rb │ │ ├── certificate_spec.rb │ │ ├── config_spec.rb │ │ ├── facts_spec.rb │ │ ├── file_spec.rb │ │ ├── help_spec.rb │ │ ├── key_spec.rb │ │ ├── node_spec.rb │ │ ├── plugin_spec.rb │ │ ├── report_spec.rb │ │ ├── resource_spec.rb │ │ ├── resource_type_spec.rb │ │ └── secret_agent_spec.rb │ ├── face_spec.rb │ ├── file_bucket │ │ ├── dipper_spec.rb │ │ └── file_spec.rb │ ├── file_collection │ │ └── lookup_spec.rb │ ├── file_collection_spec.rb │ ├── file_serving │ │ ├── base_spec.rb │ │ ├── configuration │ │ │ └── parser_spec.rb │ │ ├── configuration_spec.rb │ │ ├── content_spec.rb │ │ ├── fileset_spec.rb │ │ ├── indirection_hooks_spec.rb │ │ ├── metadata_spec.rb │ │ ├── mount │ │ │ ├── file_spec.rb │ │ │ ├── modules_spec.rb │ │ │ └── plugins_spec.rb │ │ ├── mount_spec.rb │ │ └── terminus_helper_spec.rb │ ├── indirector │ │ ├── active_record_spec.rb │ │ ├── catalog │ │ │ ├── active_record_spec.rb │ │ │ ├── compiler_spec.rb │ │ │ ├── queue_spec.rb │ │ │ ├── rest_spec.rb │ │ │ ├── store_configs_spec.rb │ │ │ └── yaml_spec.rb │ │ ├── certificate │ │ │ ├── ca_spec.rb │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── certificate_request │ │ │ ├── ca_spec.rb │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── certificate_revocation_list │ │ │ ├── ca_spec.rb │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── certificate_status │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── code_spec.rb │ │ ├── direct_file_server_spec.rb │ │ ├── envelope_spec.rb │ │ ├── exec_spec.rb │ │ ├── face_spec.rb │ │ ├── facts │ │ │ ├── active_record_spec.rb │ │ │ ├── couch_spec.rb │ │ │ ├── facter_spec.rb │ │ │ ├── inventory_active_record_spec.rb │ │ │ ├── network_device_spec.rb │ │ │ ├── rest_spec.rb │ │ │ ├── store_configs_spec.rb │ │ │ └── yaml_spec.rb │ │ ├── file_bucket_file │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── file_content │ │ │ ├── file_server_spec.rb │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── file_metadata │ │ │ ├── file_server_spec.rb │ │ │ ├── file_spec.rb │ │ │ └── rest_spec.rb │ │ ├── file_server_spec.rb │ │ ├── file_spec.rb │ │ ├── indirection_spec.rb │ │ ├── inventory │ │ │ └── yaml_spec.rb │ │ ├── key │ │ │ ├── ca_spec.rb │ │ │ └── file_spec.rb │ │ ├── ldap_spec.rb │ │ ├── memory_spec.rb │ │ ├── node │ │ │ ├── active_record_spec.rb │ │ │ ├── exec_spec.rb │ │ │ ├── ldap_spec.rb │ │ │ ├── memory_spec.rb │ │ │ ├── plain_spec.rb │ │ │ ├── rest_spec.rb │ │ │ ├── store_configs_spec.rb │ │ │ └── yaml_spec.rb │ │ ├── plain_spec.rb │ │ ├── queue_spec.rb │ │ ├── report │ │ │ ├── processor_spec.rb │ │ │ ├── rest_spec.rb │ │ │ └── yaml_spec.rb │ │ ├── request_spec.rb │ │ ├── resource │ │ │ ├── active_record_spec.rb │ │ │ ├── ral_spec.rb │ │ │ ├── rest_spec.rb │ │ │ └── store_configs_spec.rb │ │ ├── resource_type │ │ │ ├── parser_spec.rb │ │ │ └── rest_spec.rb │ │ ├── rest_spec.rb │ │ ├── run │ │ │ ├── local_spec.rb │ │ │ └── rest_spec.rb │ │ ├── ssl_file_spec.rb │ │ ├── status │ │ │ └── rest_spec.rb │ │ ├── store_configs_spec.rb │ │ ├── terminus_spec.rb │ │ └── yaml_spec.rb │ ├── indirector_spec.rb │ ├── interface │ │ ├── action_builder_spec.rb │ │ ├── action_manager_spec.rb │ │ ├── action_spec.rb │ │ ├── documentation_spec.rb │ │ ├── face_collection_spec.rb │ │ ├── option_builder_spec.rb │ │ └── option_spec.rb │ ├── interface_spec.rb │ ├── module_spec.rb │ ├── network │ │ ├── authconfig_spec.rb │ │ ├── authstore_spec.rb │ │ ├── format_handler_spec.rb │ │ ├── format_spec.rb │ │ ├── formats_spec.rb │ │ ├── handler │ │ │ └── fileserver_spec.rb │ │ ├── http │ │ │ ├── api │ │ │ │ └── v1_spec.rb │ │ │ ├── compression_spec.rb │ │ │ ├── handler_spec.rb │ │ │ ├── mongrel │ │ │ │ ├── rest_spec.rb │ │ │ │ └── xmlrpc_spec.rb │ │ │ ├── mongrel_spec.rb │ │ │ ├── rack │ │ │ │ ├── rest_spec.rb │ │ │ │ └── xmlrpc_spec.rb │ │ │ ├── rack_spec.rb │ │ │ ├── webrick │ │ │ │ ├── rest_spec.rb │ │ │ │ └── xmlrpc_spec.rb │ │ │ └── webrick_spec.rb │ │ ├── http_pool_spec.rb │ │ ├── http_spec.rb │ │ ├── rest_authconfig_spec.rb │ │ ├── rights_spec.rb │ │ ├── server_spec.rb │ │ └── xmlrpc │ │ │ └── client_spec.rb │ ├── node │ │ ├── environment_spec.rb │ │ └── facts_spec.rb │ ├── node_spec.rb │ ├── other │ │ ├── selinux_spec.rb │ │ ├── transbucket_spec.rb │ │ └── transobject_spec.rb │ ├── parameter │ │ ├── path_spec.rb │ │ ├── value_collection_spec.rb │ │ └── value_spec.rb │ ├── parameter_spec.rb │ ├── parser │ │ ├── ast │ │ │ ├── arithmetic_operator_spec.rb │ │ │ ├── astarray_spec.rb │ │ │ ├── asthash_spec.rb │ │ │ ├── boolean_operator_spec.rb │ │ │ ├── casestatement_spec.rb │ │ │ ├── collection_spec.rb │ │ │ ├── collexpr_spec.rb │ │ │ ├── comparison_operator_spec.rb │ │ │ ├── definition_spec.rb │ │ │ ├── function_spec.rb │ │ │ ├── hostclass_spec.rb │ │ │ ├── ifstatement_spec.rb │ │ │ ├── in_operator_spec.rb │ │ │ ├── leaf_spec.rb │ │ │ ├── match_operator_spec.rb │ │ │ ├── minus_spec.rb │ │ │ ├── node_spec.rb │ │ │ ├── nop_spec.rb │ │ │ ├── not_spec.rb │ │ │ ├── relationship_spec.rb │ │ │ ├── resource_defaults_spec.rb │ │ │ ├── resource_override_spec.rb │ │ │ ├── resource_reference_spec.rb │ │ │ ├── resource_spec.rb │ │ │ ├── selector_spec.rb │ │ │ └── vardef_spec.rb │ │ ├── ast_spec.rb │ │ ├── collector_spec.rb │ │ ├── compiler_spec.rb │ │ ├── files_spec.rb │ │ ├── functions │ │ │ ├── create_resources_spec.rb │ │ │ ├── defined_spec.rb │ │ │ ├── extlookup_spec.rb │ │ │ ├── fqdn_rand_spec.rb │ │ │ ├── generate_spec.rb │ │ │ ├── include_spec.rb │ │ │ ├── inline_template_spec.rb │ │ │ ├── realize_spec.rb │ │ │ ├── regsubst_spec.rb │ │ │ ├── require_spec.rb │ │ │ ├── shellquote_spec.rb │ │ │ ├── split_spec.rb │ │ │ ├── sprintf_spec.rb │ │ │ ├── tag_spec.rb │ │ │ ├── template_spec.rb │ │ │ └── versioncmp_spec.rb │ │ ├── functions_spec.rb │ │ ├── lexer_spec.rb │ │ ├── parser_spec.rb │ │ ├── relationship_spec.rb │ │ ├── resource_spec.rb │ │ ├── scope_spec.rb │ │ ├── templatewrapper_spec.rb │ │ └── type_loader_spec.rb │ ├── property │ │ ├── ensure_spec.rb │ │ ├── keyvalue_spec.rb │ │ ├── list_spec.rb │ │ └── ordered_list_spec.rb │ ├── property_spec.rb │ ├── provider │ │ ├── augeas │ │ │ └── augeas_spec.rb │ │ ├── cisco_spec.rb │ │ ├── confine │ │ │ ├── exists_spec.rb │ │ │ ├── false_spec.rb │ │ │ ├── feature_spec.rb │ │ │ ├── true_spec.rb │ │ │ └── variable_spec.rb │ │ ├── confine_collection_spec.rb │ │ ├── confine_spec.rb │ │ ├── confiner_spec.rb │ │ ├── exec │ │ │ ├── posix_spec.rb │ │ │ ├── shell_spec.rb │ │ │ └── windows_spec.rb │ │ ├── group │ │ │ ├── groupadd_spec.rb │ │ │ ├── ldap_spec.rb │ │ │ └── windows_adsi_spec.rb │ │ ├── host │ │ │ └── parsed_spec.rb │ │ ├── interface │ │ │ └── cisco_spec.rb │ │ ├── ldap_spec.rb │ │ ├── macauthorization_spec.rb │ │ ├── mcx │ │ │ └── mcxcontent_spec.rb │ │ ├── mount │ │ │ └── parsed_spec.rb │ │ ├── mount_spec.rb │ │ ├── naginator_spec.rb │ │ ├── nameservice │ │ │ └── directoryservice_spec.rb │ │ ├── network_device_spec.rb │ │ ├── package │ │ │ ├── aix_spec.rb │ │ │ ├── apt_spec.rb │ │ │ ├── dpkg_spec.rb │ │ │ ├── freebsd_spec.rb │ │ │ ├── gem_spec.rb │ │ │ ├── hpux_spec.rb │ │ │ ├── macports_spec.rb │ │ │ ├── msi_spec.rb │ │ │ ├── nim_spec.rb │ │ │ ├── pacman_spec.rb │ │ │ ├── pip_spec.rb │ │ │ ├── pkg_spec.rb │ │ │ ├── pkgdmg_spec.rb │ │ │ ├── pkgutil_spec.rb │ │ │ ├── yum_spec.rb │ │ │ └── zypper_spec.rb │ │ ├── parsedfile_spec.rb │ │ ├── selboolean_spec.rb │ │ ├── selmodule-example.pp │ │ ├── selmodule_spec.rb │ │ ├── service │ │ │ ├── daemontools_spec.rb │ │ │ ├── debian_spec.rb │ │ │ ├── freebsd_spec.rb │ │ │ ├── init_spec.rb │ │ │ ├── launchd_spec.rb │ │ │ ├── redhat_spec.rb │ │ │ ├── runit_spec.rb │ │ │ ├── smf_spec.rb │ │ │ ├── src_spec.rb │ │ │ ├── systemd_spec.rb │ │ │ ├── upstart.rb │ │ │ └── windows_spec.rb │ │ ├── ssh_authorized_key │ │ │ └── parsed_spec.rb │ │ ├── sshkey │ │ │ └── parsed_spec.rb │ │ ├── user │ │ │ ├── hpux_spec.rb │ │ │ ├── ldap_spec.rb │ │ │ ├── user_role_add_spec.rb │ │ │ ├── useradd_spec.rb │ │ │ └── windows_adsi_spec.rb │ │ ├── vlan │ │ │ └── cisco_spec.rb │ │ ├── zfs │ │ │ └── solaris_spec.rb │ │ ├── zone │ │ │ └── solaris_spec.rb │ │ └── zpool │ │ │ └── solaris_spec.rb │ ├── provider_spec.rb │ ├── puppet │ │ ├── provider │ │ │ └── README.markdown │ │ └── type │ │ │ └── README.markdown │ ├── puppet_spec.rb │ ├── rails │ │ ├── host_spec.rb │ │ ├── param_value_spec.rb │ │ └── resource_spec.rb │ ├── rails_spec.rb │ ├── relationship_spec.rb │ ├── reports │ │ ├── http_spec.rb │ │ ├── rrdgraph_spec.rb │ │ ├── store_spec.rb │ │ └── tagmail_spec.rb │ ├── reports_spec.rb │ ├── resource │ │ ├── catalog_spec.rb │ │ ├── status_spec.rb │ │ ├── type_collection_helper_spec.rb │ │ ├── type_collection_spec.rb │ │ └── type_spec.rb │ ├── resource_spec.rb │ ├── run_spec.rb │ ├── semver_spec.rb │ ├── simple_graph_spec.rb │ ├── ssl │ │ ├── base_spec.rb │ │ ├── certificate_authority │ │ │ └── interface_spec.rb │ │ ├── certificate_authority_spec.rb │ │ ├── certificate_factory_spec.rb │ │ ├── certificate_request_spec.rb │ │ ├── certificate_revocation_list_spec.rb │ │ ├── certificate_spec.rb │ │ ├── host_spec.rb │ │ ├── inventory_spec.rb │ │ └── key_spec.rb │ ├── sslcertificates │ │ └── ca_spec.rb │ ├── status_spec.rb │ ├── transaction │ │ ├── event_manager_spec.rb │ │ ├── event_spec.rb │ │ ├── report_spec.rb │ │ └── resource_harness_spec.rb │ ├── transaction_spec.rb │ ├── transportable_spec.rb │ ├── type │ │ ├── augeas_spec.rb │ │ ├── component_spec.rb │ │ ├── computer_spec.rb │ │ ├── cron_spec.rb │ │ ├── exec_spec.rb │ │ ├── file │ │ │ ├── checksum_spec.rb │ │ │ ├── content_spec.rb │ │ │ ├── ctime.rb │ │ │ ├── ensure_spec.rb │ │ │ ├── group_spec.rb │ │ │ ├── mtime.rb │ │ │ ├── owner_spec.rb │ │ │ ├── selinux_spec.rb │ │ │ ├── source_spec.rb │ │ │ └── type.rb │ │ ├── file_spec.rb │ │ ├── filebucket_spec.rb │ │ ├── group_spec.rb │ │ ├── host_spec.rb │ │ ├── interface_spec.rb │ │ ├── macauthorization_spec.rb │ │ ├── maillist_spec.rb │ │ ├── mcx_spec.rb │ │ ├── mount_spec.rb │ │ ├── nagios_spec.rb │ │ ├── noop_metaparam_spec.rb │ │ ├── package_spec.rb │ │ ├── resources_spec.rb │ │ ├── schedule_spec.rb │ │ ├── selboolean_spec.rb │ │ ├── selmodule_spec.rb │ │ ├── service_spec.rb │ │ ├── ssh_authorized_key_spec.rb │ │ ├── sshkey_spec.rb │ │ ├── stage_spec.rb │ │ ├── tidy_spec.rb │ │ ├── user_spec.rb │ │ ├── vlan_spec.rb │ │ ├── whit_spec.rb │ │ ├── zfs_spec.rb │ │ ├── zone_spec.rb │ │ └── zpool_spec.rb │ ├── type_spec.rb │ ├── util │ │ ├── adsi_spec.rb │ │ ├── autoload │ │ │ └── file_cache_spec.rb │ │ ├── autoload_spec.rb │ │ ├── backups_spec.rb │ │ ├── cache_accumulator_spec.rb │ │ ├── cacher_spec.rb │ │ ├── checksums_spec.rb │ │ ├── command_line_spec.rb │ │ ├── constant_inflector_spec.rb │ │ ├── errors_spec.rb │ │ ├── execution_spec.rb │ │ ├── execution_stub_spec.rb │ │ ├── feature_spec.rb │ │ ├── file_locking_spec.rb │ │ ├── filetype_spec.rb │ │ ├── inline_docs_spec.rb │ │ ├── ldap │ │ │ ├── connection_spec.rb │ │ │ ├── generator_spec.rb │ │ │ └── manager_spec.rb │ │ ├── loadedfile_spec.rb │ │ ├── log │ │ │ └── destinations_spec.rb │ │ ├── log_spec.rb │ │ ├── logging_spec.rb │ │ ├── metric_spec.rb │ │ ├── monkey_patches_spec.rb │ │ ├── nagios_maker_spec.rb │ │ ├── network_device │ │ │ ├── cisco │ │ │ │ ├── device_spec.rb │ │ │ │ ├── facts_spec.rb │ │ │ │ └── interface_spec.rb │ │ │ ├── config_spec.rb │ │ │ ├── ipcalc_spec.rb │ │ │ └── transport │ │ │ │ ├── base_spec.rb │ │ │ │ ├── ssh_spec.rb │ │ │ │ └── telnet_spec.rb │ │ ├── network_device_spec.rb │ │ ├── package_spec.rb │ │ ├── posix_spec.rb │ │ ├── pson_spec.rb │ │ ├── queue │ │ │ └── stomp_spec.rb │ │ ├── queue_spec.rb │ │ ├── rdoc │ │ │ └── parser_spec.rb │ │ ├── rdoc_spec.rb │ │ ├── reference_serializer_spec.rb │ │ ├── resource_template_spec.rb │ │ ├── run_mode_spec.rb │ │ ├── selinux_spec.rb │ │ ├── settings │ │ │ └── file_setting_spec.rb │ │ ├── settings_spec.rb │ │ ├── storage_spec.rb │ │ ├── suidmanager_spec.rb │ │ ├── tagging_spec.rb │ │ ├── user_attr_spec.rb │ │ ├── warnings_spec.rb │ │ └── zaml_spec.rb │ └── util_spec.rb └── watchr.rb ├── tasks └── rake │ ├── changelog.rake │ ├── ci.rake │ ├── dailybuild.rake │ ├── gem.rake │ ├── git_workflow.rake │ ├── manpages.rake │ ├── metrics.rake │ ├── sign.rake │ ├── testbranch.rake │ └── yard.rake └── test ├── README ├── Rakefile ├── certmgr ├── certmgr.rb ├── inventory.rb └── support.rb ├── data ├── failers │ ├── badclassnoparam │ ├── badclassparam │ ├── badcompnoparam │ ├── badcompparam │ ├── badtypeparam │ └── noobjectrvalue ├── providers │ ├── cron │ │ ├── crontab.allthree │ │ ├── crontab.envNcomment │ │ ├── crontab.envNname │ │ ├── crontab.multirecords │ │ ├── crontab_collections.yaml │ │ ├── crontab_multiple_with_env.yaml │ │ ├── crontab_sample_records.yaml │ │ └── examples │ │ │ ├── freebsd │ │ │ ├── one │ │ │ └── openbsd │ ├── host │ │ └── parsed │ │ │ └── valid_hosts │ ├── mailalias │ │ └── aliases │ │ │ └── test1 │ ├── mount │ │ └── parsed │ │ │ ├── aix.mount │ │ │ ├── darwin.mount │ │ │ ├── hpux.mount │ │ │ ├── linux.mount │ │ │ └── solaris.mount │ ├── package │ │ └── testpackages.yaml │ └── ssh_authorized_key │ │ └── parsed │ │ ├── authorized_keys │ │ ├── authorized_keys1 │ │ └── authorized_keys2 ├── reports │ ├── 1.yaml │ ├── 2.yaml │ ├── tagmail_failers.conf │ └── tagmail_passers.conf ├── snippets │ ├── aliastest.pp │ ├── append.pp │ ├── argumentdefaults │ ├── arithmetic_expression.pp │ ├── arraytrailingcomma.pp │ ├── casestatement.pp │ ├── classheirarchy.pp │ ├── classincludes.pp │ ├── classpathtest │ ├── collection.pp │ ├── collection_override.pp │ ├── collection_within_virtual_definitions.pp │ ├── componentmetaparams.pp │ ├── componentrequire.pp │ ├── deepclassheirarchy.pp │ ├── defineoverrides.pp │ ├── emptyclass.pp │ ├── emptyexec.pp │ ├── emptyifelse.pp │ ├── falsevalues.pp │ ├── filecreate │ ├── fqdefinition.pp │ ├── fqparents.pp │ ├── funccomma.pp │ ├── hash.pp │ ├── ifexpression.pp │ ├── implicititeration │ ├── multilinecomments.pp │ ├── multipleclass.pp │ ├── multipleinstances │ ├── multisubs.pp │ ├── namevartest │ ├── scopetest │ ├── selectorvalues.pp │ ├── simpledefaults │ ├── simpleselector │ ├── singleary.pp │ ├── singlequote.pp │ ├── singleselector.pp │ ├── subclass_name_duplication.pp │ ├── tag.pp │ ├── tagged.pp │ └── virtualresources.pp └── types │ ├── hosts │ ├── 1 │ ├── 2 │ └── solaris │ ├── mailalias │ └── file1 │ ├── mount │ ├── freebsd.fstab │ ├── linux.fstab │ └── solaris.fstab │ ├── port │ ├── 1 │ └── darwin │ ├── ssh_authorized_key │ └── 1 │ ├── sshkey │ └── 1 │ └── yumrepos │ ├── fedora-devel.repo │ └── fedora.repo ├── language ├── ast.rb ├── functions.rb ├── parser.rb ├── scope.rb ├── snippets.rb └── transportable.rb ├── lib ├── puppettest.rb ├── puppettest │ ├── certificates.rb │ ├── exetest.rb │ ├── fakes.rb │ ├── fileparsing.rb │ ├── filetesting.rb │ ├── parsertesting.rb │ ├── railstesting.rb │ ├── reporttesting.rb │ ├── resourcetesting.rb │ ├── runnable_test.rb │ ├── servertest.rb │ ├── support.rb │ ├── support │ │ ├── assertions.rb │ │ ├── helpers.rb │ │ ├── resources.rb │ │ └── utils.rb │ └── testcase.rb ├── rake │ ├── puppet_test_loader.rb │ └── puppet_testtask.rb └── stubba.rb ├── network ├── authconfig.rb ├── authorization.rb ├── authstore.rb ├── client │ ├── ca.rb │ └── dipper.rb ├── client_request.rb ├── handler │ ├── ca.rb │ ├── fileserver.rb │ ├── master.rb │ ├── report.rb │ └── runner.rb ├── rights.rb ├── server │ ├── mongrel_test.rb │ └── webrick.rb └── xmlrpc │ ├── client.rb │ ├── processor.rb │ ├── server.rb │ └── webrick_servlet.rb ├── other ├── provider.rb ├── puppet.rb ├── relationships.rb ├── report.rb └── transactions.rb ├── puppet ├── defaults.rb └── errortest.rb ├── rails ├── rails.rb └── railsparameter.rb ├── ral ├── manager │ ├── attributes.rb │ ├── instances.rb │ ├── manager.rb │ ├── provider.rb │ └── type.rb ├── providers │ ├── cron │ │ └── crontab.rb │ ├── group.rb │ ├── host │ │ └── parsed.rb │ ├── mailalias │ │ └── aliases.rb │ ├── nameservice.rb │ ├── package.rb │ ├── package │ │ ├── aptitude.rb │ │ └── aptrpm.rb │ ├── parsedfile.rb │ ├── port │ │ └── parsed.rb │ ├── provider.rb │ ├── service │ │ └── base.rb │ ├── sshkey │ │ └── parsed.rb │ ├── user.rb │ └── user │ │ └── useradd.rb └── type │ ├── cron.rb │ ├── exec.rb │ ├── file.rb │ ├── file │ └── target.rb │ ├── fileignoresource.rb │ ├── filesources.rb │ ├── host.rb │ ├── mailalias.rb │ ├── port.rb │ ├── resources.rb │ ├── service.rb │ ├── sshkey.rb │ ├── user.rb │ ├── yumrepo.rb │ └── zone.rb ├── test └── util ├── classgen.rb ├── execution.rb ├── fileparsing.rb ├── inifile.rb ├── instance_loader.rb ├── log.rb ├── metrics.rb ├── package.rb ├── pidlock.rb ├── settings.rb ├── storage.rb ├── subclass_loader.rb └── utiltest.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .rspec 2 | results 3 | .*.sw[op] 4 | -------------------------------------------------------------------------------- /.testseries: -------------------------------------------------------------------------------- 1 | tickets/master/3015 2 | tickets/master/2596 3 | -------------------------------------------------------------------------------- /acceptance/pending/ticket_3360_reject_duplicate_csr_with_option_unset.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/acceptance/pending/ticket_3360_reject_duplicate_csr_with_option_unset.rb -------------------------------------------------------------------------------- /acceptance/pending/ticket_6710_relationship_syntax_should_work_with_title_arrays.rb: -------------------------------------------------------------------------------- 1 | test_name "#6710: Relationship syntax should work with title arraysA" 2 | 3 | # Jeff McCune 4 | # 2011-03-14 5 | # 6 | # If bug 6710 is closed, then this manifests should apply cleanly. 7 | # There should be a many-to-many relationship established. 8 | # 9 | 10 | apply_manifest_on agents, %q{ 11 | notify { [ left_one, left_two ]: } -> notify { [ right_one, right_two ]: } 12 | notify { left: } -> notify { right: } 13 | notify { left_one_to_many: } -> notify { [ right_one_to_many_1, right_one_to_many_2 ]: } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /acceptance/tests/allow_arbitrary_node_name_for_apply.rb: -------------------------------------------------------------------------------- 1 | test_name "node_name_value should be used as the node name for puppet apply" 2 | 3 | success_message = "node_name_value setting was correctly used as the node name" 4 | 5 | manifest = %Q[ 6 | Exec { path => "/usr/bin:/bin" } 7 | node default { 8 | exec { "false": } 9 | } 10 | node a_different_node_name { 11 | exec { "echo #{success_message}": } 12 | } 13 | ] 14 | 15 | on agents, puppet_apply("--verbose --node_name_value a_different_node_name"), :stdin => manifest do 16 | assert_match(success_message, stdout) 17 | end 18 | -------------------------------------------------------------------------------- /acceptance/tests/apply/classes/should_allow_param_override.rb: -------------------------------------------------------------------------------- 1 | test_name "should allow param override" 2 | 3 | manifest = %q{ 4 | class parent { 5 | notify { 'msg': 6 | message => parent, 7 | } 8 | } 9 | class child inherits parent { 10 | Notify['msg'] {message => 'child'} 11 | } 12 | include parent 13 | include child 14 | } 15 | 16 | apply_manifest_on(agents, manifest) do 17 | fail_test "parameter override didn't work" unless 18 | stdout.include? "defined 'message' as 'child'" 19 | end 20 | 21 | -------------------------------------------------------------------------------- /acceptance/tests/apply/classes/should_include_resources_from_class.rb: -------------------------------------------------------------------------------- 1 | test_name "resources declared in a class can be applied with include" 2 | manifest = %q{ 3 | class x { 4 | notify{'a':} 5 | } 6 | include x 7 | } 8 | apply_manifest_on(agents, manifest) do 9 | fail_test "the resource did not apply" unless 10 | stdout.include? "defined 'message' as 'a'" 11 | end 12 | -------------------------------------------------------------------------------- /acceptance/tests/apply/classes/should_not_auto_include_resources_from_class.rb: -------------------------------------------------------------------------------- 1 | test_name "resources declared in classes are not applied without include" 2 | manifest = %q{ class x { notify { 'test': message => 'never invoked' } } } 3 | apply_manifest_on(agents, manifest) do 4 | fail_test "found the notify despite not including it" if 5 | stdout.include? "never invoked" 6 | end 7 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_else.rb: -------------------------------------------------------------------------------- 1 | test_name "else clause will be reached if no expressions match" 2 | manifest = %q{ 3 | if( 1 == 2) { 4 | notice('if') 5 | } elsif(2 == 3) { 6 | notice('elsif') 7 | } else { 8 | notice('else') 9 | } 10 | } 11 | 12 | apply_manifest_on(agents, manifest) do 13 | fail_test "the else clause did not evaluate" unless stdout.include? 'else' 14 | end 15 | 16 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_elsif.rb: -------------------------------------------------------------------------------- 1 | test_name "should evaluate the elsif block in a conditional" 2 | manifest = %q{ 3 | if( 1 == 3) { 4 | notice('if') 5 | } elsif(2 == 2) { 6 | notice('elsif') 7 | } else { 8 | notice('else') 9 | } 10 | } 11 | 12 | apply_manifest_on(agents, manifest) do 13 | fail_test "didn't evaluate elsif" unless stdout.include? 'elsif' 14 | end 15 | 16 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_empty.rb: -------------------------------------------------------------------------------- 1 | test_name "ensure that undefined variables evaluate as false" 2 | manifest = %q{ 3 | if $undef_var { 4 | } else { 5 | notice('undef') 6 | } 7 | } 8 | 9 | apply_manifest_on(agents, manifest) do 10 | fail_test "did not evaluate as expected" unless stdout.include? 'undef' 11 | end 12 | 13 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_false.rb: -------------------------------------------------------------------------------- 1 | test_name "test that false evaluates to false" 2 | manifest = %q{ 3 | if false { 4 | } else { 5 | notice('false') 6 | } 7 | } 8 | 9 | apply_manifest_on(agents, manifest) do 10 | fail_test "didn't evaluate false correcly" unless stdout.include? 'false' 11 | end 12 | 13 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_if.rb: -------------------------------------------------------------------------------- 1 | test_name = "should evaluate an if block correctly" 2 | manifest = %q{ 3 | if( 1 == 1) { 4 | notice('if') 5 | } elsif(2 == 2) { 6 | notice('elsif') 7 | } else { 8 | notice('else') 9 | } 10 | } 11 | 12 | apply_manifest_on(agents, manifest) do 13 | fail_test "didn't evaluate correctly" unless stdout.include? 'if' 14 | end 15 | 16 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_strings_true.rb: -------------------------------------------------------------------------------- 1 | test_name "test that the string 'false' evaluates to true" 2 | manifest = %q{ 3 | if 'false' { 4 | notice('true') 5 | } else { 6 | notice('false') 7 | } 8 | } 9 | 10 | apply_manifest_on(agents, manifest) do 11 | fail_test "string 'false' didn't evaluate as true" unless 12 | stdout.include? 'true' 13 | end 14 | -------------------------------------------------------------------------------- /acceptance/tests/apply/conditionals/should_evaluate_undef.rb: -------------------------------------------------------------------------------- 1 | test_name "empty string should evaluate as false" 2 | manifest = %q{ 3 | if '' { 4 | } else { 5 | notice('empty') 6 | } 7 | } 8 | 9 | apply_manifest_on(agents, manifest) do 10 | fail_test "didn't evaluate as false" unless stdout.include? 'empty' 11 | end 12 | -------------------------------------------------------------------------------- /acceptance/tests/apply/hashes/should_not_reassign.rb: -------------------------------------------------------------------------------- 1 | test_name "hash reassignment should fail" 2 | manifest = %q{ 3 | $my_hash = {'one' => '1', 'two' => '2' } 4 | $my_hash['one']='1.5' 5 | } 6 | 7 | apply_manifest_on(agents, manifest, :acceptable_exit_codes => [1]) do 8 | fail_test "didn't find the failure" unless 9 | stderr.include? "Assigning to the hash 'my_hash' with an existing key 'one'" 10 | end 11 | -------------------------------------------------------------------------------- /acceptance/tests/doc/should_print_function_reference.rb: -------------------------------------------------------------------------------- 1 | test_name "verify we can print the function reference" 2 | on(agents, puppet_doc("-r", "function")) do 3 | fail_test "didn't print function reference" unless 4 | stdout.include? 'Function Reference' 5 | end 6 | -------------------------------------------------------------------------------- /acceptance/tests/doc/ticket_4120_cannot_generate_type_reference.rb: -------------------------------------------------------------------------------- 1 | test_name "verify we can print the function reference" 2 | on(agents, puppet_doc("-r", "type")) do 3 | fail_test "didn't print type reference" unless 4 | stdout.include? 'Type Reference' 5 | end 6 | -------------------------------------------------------------------------------- /acceptance/tests/jeff_append_to_array.rb: -------------------------------------------------------------------------------- 1 | # Ported from the acceptance test suite. 2 | test_name "Jeff: Append to Array" 3 | 4 | manifest = %q{ 5 | class parent { 6 | $arr1 = [ "parent array element" ] 7 | } 8 | class parent::child inherits parent { 9 | $arr1 += [ "child array element" ] 10 | notify { $arr1: } 11 | } 12 | include parent::child 13 | } 14 | 15 | agents.each do |host| 16 | apply_manifest_on(host, manifest) do 17 | assert_match(/notice: parent array element/, stdout, "#{host}: parent missing") 18 | assert_match(/notice: child array element/, stdout, "#{host}: child missing") 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /acceptance/tests/puppet_apply_basics.rb: -------------------------------------------------------------------------------- 1 | # Ported from a collection of small spec tests in acceptance. 2 | # 3 | # Unified into a single file because they are literally one-line tests! 4 | 5 | test_name "Trivial puppet tests" 6 | 7 | step "check that puppet apply displays notices" 8 | agents.each do |host| 9 | apply_manifest_on(host, "notice 'Hello World'") do 10 | assert_match(/notice:.*Hello World/, stdout, "#{host}: missing notice!") 11 | end 12 | end 13 | 14 | step "verify help displays something for puppet master" 15 | on master, puppet_master("--help") do 16 | assert_match(/puppet master/, stdout, "improper help output") 17 | end 18 | -------------------------------------------------------------------------------- /acceptance/tests/puppet_apply_should_show_a_notice.rb: -------------------------------------------------------------------------------- 1 | test_name "puppet apply should show a notice" 2 | 3 | agents.each do |host| 4 | apply_manifest_on(host, "notice 'Hello World'") do 5 | assert_match(/notice: .*: Hello World/, stdout, "#{host}: the notice didn't show") 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /acceptance/tests/puppet_master_help_should_mention_puppet_master.rb: -------------------------------------------------------------------------------- 1 | test_name "puppet master help should mention puppet master" 2 | on master, puppet_master('--help') do 3 | fail_test "puppet master wasn't mentioned" unless stdout.include? 'puppet master' 4 | end 5 | -------------------------------------------------------------------------------- /acceptance/tests/resource/exec/should_set_path.rb: -------------------------------------------------------------------------------- 1 | test_name "the path statement should work to locate commands" 2 | 3 | file = "/tmp/touched-should-set-path-#{Time.new.to_i}" 4 | 5 | step "clean up the system for the test" 6 | on agents, "rm -f #{file}" 7 | 8 | step "invoke the exec resource with a path set" 9 | on(agents, puppet_resource('exec', 'test', 10 | "command='touch #{file}'", 'path="/bin:/usr/bin"')) 11 | 12 | step "verify that the files were created" 13 | on agents, "test -f #{file}" 14 | 15 | step "clean up the system after testing" 16 | on agents, "rm -f #{file}" 17 | -------------------------------------------------------------------------------- /acceptance/tests/resource/file/should_create_directory.rb: -------------------------------------------------------------------------------- 1 | test_name "should create directory" 2 | 3 | target = "/tmp/test-#{Time.new.to_i}" 4 | 5 | step "clean up the system before we begin" 6 | on agents, "rm -rf #{target}" 7 | 8 | step "verify we can create a directory" 9 | on(agents, puppet_resource("file", target, 'ensure=directory')) 10 | 11 | step "verify the directory was created" 12 | on agents, "test -d #{target}" 13 | 14 | step "clean up after the test run" 15 | on agents, "rm -rf #{target}" 16 | -------------------------------------------------------------------------------- /acceptance/tests/resource/file/should_create_empty.rb: -------------------------------------------------------------------------------- 1 | test_name "should create empty file for 'present'" 2 | 3 | target = "/tmp/test-#{Time.new.to_i}" 4 | 5 | step "clean up the system before we begin" 6 | on agents, "rm -rf #{target}" 7 | 8 | step "verify we can create an empty file" 9 | on(agents, puppet_resource("file", target, 'ensure=present')) 10 | 11 | step "verify the target was created" 12 | on agents, "test -f #{target} && test ! -s #{target}" 13 | 14 | step "clean up after the test run" 15 | on agents, "rm -rf #{target}" 16 | -------------------------------------------------------------------------------- /acceptance/tests/resource/file/should_remove_file.rb: -------------------------------------------------------------------------------- 1 | test_name "should remove file" 2 | 3 | target = "/tmp/test-#{Time.new.to_i}" 4 | 5 | step "clean up the system before we begin" 6 | on agents, "rm -rf #{target} && touch #{target}" 7 | 8 | step "verify we can remove a file" 9 | on(agents, puppet_resource("file", target, 'ensure=absent')) 10 | 11 | step "verify that the file is gone" 12 | on agents, "test -e #{target}", :acceptable_exit_codes => [1] 13 | -------------------------------------------------------------------------------- /acceptance/tests/resource/group/should_create.rb: -------------------------------------------------------------------------------- 1 | test_name "should create group" 2 | 3 | name = "pl#{rand(999999).to_i}" 4 | 5 | def cleanup(name) 6 | step "remove group #{name} if it exists" 7 | on agents, "if getent group #{name}; then groupdel #{name}; fi" 8 | end 9 | 10 | cleanup(name) 11 | 12 | step "create the group #{name} with the resource agent" 13 | on(agents, puppet_resource('group', name, 'ensure=present')) 14 | 15 | step "verify the group #{name} was created" 16 | on(agents, "getent group #{name}") do 17 | fail_test "group information is not sensible" unless stdout =~ /^#{name}:.*:[0-9]+:/ 18 | end 19 | 20 | cleanup(name) 21 | -------------------------------------------------------------------------------- /acceptance/tests/resource/group/should_destroy.rb: -------------------------------------------------------------------------------- 1 | test_name "should destroy a group" 2 | 3 | name = "test-group-#{Time.new.to_i}" 4 | 5 | step "ensure the group exists on the target system" 6 | on agents, "getent group #{name} || groupadd #{name}" 7 | 8 | step "use puppet to remove the group" 9 | on(agents, puppet_resource('group', name, 'ensure=absent')) 10 | 11 | step "verify that the group has been removed" 12 | # REVISIT: I /think/ that exit code 2 is standard across Linux, but I have no 13 | # idea what non-Linux platforms are going to return. --daniel 2010-12-24 14 | on agents, "getent group #{name}", :acceptable_exit_codes => [2] 15 | -------------------------------------------------------------------------------- /acceptance/tests/resource/group/should_not_create_existing.rb: -------------------------------------------------------------------------------- 1 | test_name "group should not create existing group" 2 | 3 | name = "test-group-#{Time.new.to_i}" 4 | 5 | step "ensure the group exists on the target node" 6 | on(agents, puppet_resource('group', name, 'ensure=present')) 7 | 8 | step "verify that we don't try and create the existing group" 9 | on(agents, puppet_resource('group', name, 'ensure=present')) do 10 | fail_test "looks like we created the group" if 11 | stdout.include? '/Group[bozo]/ensure: created' 12 | end 13 | 14 | step "clean up the system after the test run" 15 | on(agents, puppet_resource('group', name, 'ensure=absent')) 16 | -------------------------------------------------------------------------------- /acceptance/tests/resource/group/should_not_destoy_unexisting.rb: -------------------------------------------------------------------------------- 1 | test_name "should not destroy a group that doesn't exist" 2 | 3 | name = "test-group-#{Time.new.to_i}" 4 | 5 | step "verify the group does not already exist" 6 | on(agents, puppet_resource('group', name, 'ensure=absent')) 7 | 8 | step "verify that we don't remove the group when it doesn't exist" 9 | on(agents, puppet_resource('group', name, 'ensure=absent')) do 10 | fail_test "it looks like we tried to remove the group" if 11 | stdout.include? "notice: /Group[#{name}]/ensure: removed" 12 | end 13 | 14 | -------------------------------------------------------------------------------- /acceptance/tests/resource/group/should_query.rb: -------------------------------------------------------------------------------- 1 | test_name "group should query" 2 | 3 | name = "test-group-#{Time.new.to_i}" 4 | 5 | step "ensure the group exists on the target systems" 6 | on agents, "getent group #{name} || groupadd #{name}" 7 | 8 | step "ensure that the resource agent sees the group" 9 | on(agents, puppet_resource('group', name)) do 10 | fail_test "missing group identifier" unless stdout.include? "group { '#{name}':" 11 | fail_test "missing present attributed" unless stdout.include? "ensure => 'present'" 12 | end 13 | 14 | step "clean up the system after the test" 15 | on(agents, puppet_resource('group', name, 'ensure=absent')) 16 | -------------------------------------------------------------------------------- /acceptance/tests/resource/host/should_create.rb: -------------------------------------------------------------------------------- 1 | test_name "host should create" 2 | 3 | target = "/tmp/host-#{Time.new.to_i}" 4 | 5 | step "clean up for the test" 6 | on agents, "rm -f #{target}" 7 | 8 | step "create the host record" 9 | on(agents, puppet_resource("host", "test", "ensure=present", 10 | "ip=127.0.0.1", "target=#{target}")) 11 | 12 | step "verify that the record was created" 13 | on(agents, "cat #{target} ; rm -f #{target}") do 14 | fail_test "record was not present" unless stdout =~ /^127\.0\.0\.1[[:space:]]+test/ 15 | end 16 | -------------------------------------------------------------------------------- /acceptance/tests/resource/host/should_create_aliases.rb: -------------------------------------------------------------------------------- 1 | test_name "host should create aliases" 2 | 3 | target = "/tmp/host-#{Time.new.to_i}" 4 | 5 | step "clean up the system for testing" 6 | on agents, "rm -f #{target}" 7 | 8 | step "create the record" 9 | on(agents, puppet_resource('host', 'test', "ensure=present", 10 | "ip=127.0.0.7", "target=#{target}", "host_aliases=alias")) 11 | 12 | step "verify that the aliases were added" 13 | on(agents, "cat #{target} ; rm -f #{target}") do 14 | fail_test "alias was missing" unless 15 | stdout =~ /^127\.0\.0\.7[[:space:]]+test[[:space:]]alias/ 16 | end 17 | -------------------------------------------------------------------------------- /acceptance/tests/resource/host/should_query.rb: -------------------------------------------------------------------------------- 1 | test_name "should query hosts out of a hosts file" 2 | 3 | file = "/tmp/hosts-#{Time.new.to_i}" 4 | 5 | step "set up the system for the test" 6 | on agents, "printf '127.0.0.1 localhost.local localhost\n' > #{file}" 7 | 8 | step "fetch the list of hosts from puppet" 9 | on(agents, puppet_resource('host', 'localhost', "target=#{file}")) do 10 | found = stdout.scan('present').length 11 | fail_test "found #{found} hosts, not 1" if found != 1 12 | end 13 | 14 | step "clean up the system" 15 | on agents, "rm -f #{file}" 16 | -------------------------------------------------------------------------------- /acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb: -------------------------------------------------------------------------------- 1 | test_name "#4123: should list all running services on Redhat/CentOS" 2 | step "Validate services running agreement ralsh vs. OS service count" 3 | # This will remotely exec: 4 | # ticket_4123_should_list_all_running_redhat.sh 5 | 6 | hosts.each do |host| 7 | if host['platform'].include?('centos') or host['platform'].include?('rhel') 8 | run_script_on(host,'acceptance-tests/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh') 9 | else 10 | skip_test "Test not supported on this plaform" 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.rb: -------------------------------------------------------------------------------- 1 | test_name "#4124: should list all disabled services on Redhat/CentOS" 2 | step "Validate disabled services agreement ralsh vs. OS service count" 3 | # This will remotely exec: 4 | # ticket_4124_should_list_all_disabled.sh 5 | 6 | hosts.each do |host| 7 | unless host['platform'].include? 'centos' or host['platform'].include? 'rhel' 8 | skip_test "Test not supported on this plaform" 9 | else 10 | run_script_on(host,'acceptance-tests/tests/resource/service/ticket_4124_should_list_all_disabled.sh') 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /acceptance/tests/resource/user/should_not_create_existing.rb: -------------------------------------------------------------------------------- 1 | test_name "tests that user resource will not add users that already exist." 2 | 3 | step "verify that we don't try to create a user account that already exists" 4 | on(agents, puppet_resource('user', 'root', 'ensure=present')) do 5 | fail_test "tried to create 'root' user" if stdout.include? 'created' 6 | end 7 | -------------------------------------------------------------------------------- /acceptance/tests/resource/user/should_not_destoy_unexisting.rb: -------------------------------------------------------------------------------- 1 | test_name "ensure that puppet does not report removing a user that does not exist" 2 | 3 | name = "pl#{rand(999999).to_i}" 4 | 5 | step "verify that user #{name} does not exist" 6 | on agents, "getent passwd #{name}", :acceptable_exit_codes => [2] 7 | 8 | step "ensure absent doesn't try and do anything" 9 | on(agents, puppet_resource('user', name, 'ensure=absent')) do 10 | fail_test "tried to remove the user, apparently" if stdout.include? 'removed' 11 | end 12 | -------------------------------------------------------------------------------- /acceptance/tests/resource/user/should_query.rb: -------------------------------------------------------------------------------- 1 | test_name "test that we can query and find a user that exists." 2 | 3 | name = "pl#{rand(999999).to_i}" 4 | 5 | step "ensure that our test user exists" 6 | on(agents, puppet_resource('user', name, 'ensure=present')) 7 | 8 | step "query for the resource and verify it was found" 9 | on(agents, puppet_resource('user', name)) do 10 | fail_test "didn't find the user #{name}" unless stdout.include? 'present' 11 | end 12 | 13 | step "clean up the user and group we added" 14 | on(agents, puppet_resource('user', name, 'ensure=absent')) 15 | on(agents, puppet_resource('group', name, 'ensure=absent')) 16 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_3172_puppet_kick_with_hostnames_on_the_command_line.rb: -------------------------------------------------------------------------------- 1 | test_name "#3172: puppet kick with hostnames on the command line" 2 | step "verify that we trigger our host" 3 | 4 | target = 'working.example.org' 5 | agents.each do |host| 6 | on(host, puppet_kick(target), :acceptable_exit_codes => [3]) { 7 | assert_match(/Triggering #{target}/, stdout, "didn't trigger #{target} on #{host}" ) 8 | } 9 | end 10 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_3656_requiring_multiple_resources.rb: -------------------------------------------------------------------------------- 1 | test_name "#3656: requiring multiple resources" 2 | apply_manifest_on agents, %q{ 3 | notify { 'foo': } 4 | notify { 'bar': } 5 | notify { 'baz': 6 | require => [Notify['foo'], Notify['bar']], 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_4110_puppet_apply_should_not_create_a_user_that_already_exists.rb: -------------------------------------------------------------------------------- 1 | test_name "#4110: puppet apply should not create a user that already exists" 2 | 3 | agents.each do |host| 4 | apply_manifest_on(host, "user { 'root': ensure => 'present' }") do 5 | assert_no_match(/created/, stdout, "we tried to create root on #{host}" ) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_4233_resource_with_a_newline.rb: -------------------------------------------------------------------------------- 1 | test_name "#4233: resource with a newline" 2 | 3 | # 2010-07-22 Jeff McCune 4 | # AffectedVersion: 2.6.0rc3 5 | # FixedVersion: 2.6.0 6 | 7 | # JJM We expect 2.6.0rc3 to return an error 8 | # and 2.6.0 final to not return an error line. 9 | # Look for the line in the output and fail the test 10 | # if we find it. 11 | 12 | agents.each do |host| 13 | apply_manifest_on(host, 'exec { \'/bin/echo -e "\nHello World\n"\': }') do 14 | assert_no_match(/err:/, stdout, "error report in output on #{host}") 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_4285_file_resource_fail_when_name_defined_instead_of_path.rb: -------------------------------------------------------------------------------- 1 | test_name "Bug #4285: ArgumentError: Cannot alias File[mytitle] to [nil]" 2 | 3 | manifest = %q{ 4 | file { "file1": 5 | name => '/tmp/file1', 6 | source => "/tmp/", 7 | } 8 | 9 | file { "file2": 10 | name => '/tmp/file2', 11 | source => "/tmp/", 12 | } 13 | } 14 | 15 | agents.each do |host| 16 | apply_manifest_on(host, manifest) do 17 | assert_no_match(/Cannot alias/, stdout, "#{host}: found the bug report output") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_4287_undefined_method_evaluate_match_when_function_call_used_in_an_if_statement.rb: -------------------------------------------------------------------------------- 1 | test_name "Bug #4287: undefined method 'evaluate_match' when function call used in an 'if' statement" 2 | 3 | manifest = %q{ 4 | $foo='abc' 5 | if $foo != regsubst($foo,'abc','def') { 6 | notify { 'No issue here...': } 7 | } 8 | } 9 | 10 | agents.each do |host| 11 | apply_manifest_on(host, manifest) do 12 | assert_match(/notice: No issue here.../, stdout, "didn't get the expected notice on #{host}") 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_6734_6256_5530_5503.rb: -------------------------------------------------------------------------------- 1 | # Puppet master fails to start due to impropper 2 | # permissons on the puppet/ dir. Specially, the rrd 3 | # sub dir is not created when puppet master starts 4 | 5 | test_name "Tickets 6734 6256 5530 5503i Puppet Master fails to start" 6 | 7 | with_master_running_on(master) do 8 | step "Check permissions on puppet/rrd/" 9 | on master, "ls -l /var/lib/puppet | grep rrd | awk '{print $3\" \"$4}'" do 10 | assert_match(/puppet puppet/, stdout, "puppet/rrd does not exist/wrong permissions") 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /acceptance/tests/ticket_7139_puppet_resource_file_qualified_paths.rb: -------------------------------------------------------------------------------- 1 | test_name "#7139: Puppet resource file failes on path with leading '/'" 2 | 3 | step "Agents: create valid, invalid formatted manifests" 4 | create_remote_file(agents, '/tmp/ticket-7139', %w{foo bar contents} ) 5 | 6 | step "Run puppet file resource on /tmp/ticket-7139" 7 | agents.each do |host| 8 | on(host, "puppet resource file /tmp/ticket-7139") do 9 | assert_match(/file \{ \'\/tmp\/ticket-7139\':/, stdout, "puppet resource file failed on #{host}") 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /autotest/discover.rb: -------------------------------------------------------------------------------- 1 | require 'autotest' 2 | 3 | Autotest.add_discovery do 4 | "rspec" 5 | end 6 | 7 | Autotest.add_discovery do 8 | "puppet" 9 | end 10 | -------------------------------------------------------------------------------- /autotest/images/fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/autotest/images/fail.png -------------------------------------------------------------------------------- /autotest/images/pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/autotest/images/pass.png -------------------------------------------------------------------------------- /autotest/images/pending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/autotest/images/pending.png -------------------------------------------------------------------------------- /bin/filebucket: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application' 4 | require 'puppet/application/filebucket' 5 | 6 | # launch the filebucket 7 | Puppet::Application[:filebucket].run 8 | -------------------------------------------------------------------------------- /bin/pi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/describe' 4 | 5 | Puppet::Application[:describe].run 6 | -------------------------------------------------------------------------------- /bin/puppet: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/util/command_line' 4 | Puppet::Util::CommandLine.new.execute 5 | -------------------------------------------------------------------------------- /bin/puppetdoc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/doc' 4 | Puppet::Application[:doc].run 5 | -------------------------------------------------------------------------------- /bin/ralsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/resource' 4 | Puppet::Application[:resource].run 5 | -------------------------------------------------------------------------------- /conf/epm.list: -------------------------------------------------------------------------------- 1 | %product Puppet 2 | %copyright 2004-2005 by Reductive Labs, All Rights Reserved 3 | %vendor Reductive Labs 4 | %license COPYING 5 | %readme README 6 | %description System Automation and Configuration Management Software 7 | %version 0.15.0 8 | %requires facter 1.1 9 | -------------------------------------------------------------------------------- /conf/freebsd/puppetd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | 4 | # PROVIDE: puppetd 5 | # REQUIRE: NETWORK 6 | # KEYWORD: FreeBSD shutdown 7 | 8 | . /etc/rc.subr 9 | 10 | name=puppetd 11 | rcvar=`set_rcvar` 12 | 13 | # set defaults 14 | command=/usr/local/bin/puppetd 15 | pidfile="/var/run/$name.pid" 16 | #required_files="/usr/local/etc/$name.conf" 17 | 18 | # read configuration and set defaults 19 | load_rc_config "$name" 20 | : ${puppetd_enable="NO"} 21 | : ${puppetd_config="/usr/local/etc/puppet.conf"} 22 | : ${puppetd_flags=""} 23 | 24 | command_args="--config $puppetd_config $puppetd_flags" 25 | 26 | run_rc_command "$1" 27 | -------------------------------------------------------------------------------- /conf/freebsd/puppetmasterd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | 4 | # PROVIDE: puppetmasterd 5 | # REQUIRE: NETWORK 6 | # KEYWORD: FreeBSD shutdown 7 | 8 | . /etc/rc.subr 9 | 10 | name=puppetmasterd 11 | rcvar=`set_rcvar` 12 | 13 | # set defaults 14 | command=/usr/local/bin/puppetmasterd 15 | pidfile="/var/run/$name.pid" 16 | #required_files="/usr/local/etc/$name.conf" 17 | 18 | # read configuration and set defaults 19 | load_rc_config "$name" 20 | : ${puppetmasterd_enable="NO"} 21 | : ${puppetmasterd_config="/usr/local/etc/puppet.conf"} 22 | : ${puppetmasterd_flags=""} 23 | 24 | command_args="--config $puppetmasterd_config $puppetmasterd_flags" 25 | 26 | run_rc_command "$1" 27 | -------------------------------------------------------------------------------- /conf/gentoo/conf.d/puppet: -------------------------------------------------------------------------------- 1 | # Location of PID files 2 | PUPPET_PID_DIR="/var/run/puppet" 3 | 4 | # You may specify other parameters to the puppet client here 5 | #PUPPET_EXTRA_OPTS="" 6 | -------------------------------------------------------------------------------- /conf/gentoo/conf.d/puppetmaster: -------------------------------------------------------------------------------- 1 | # Location of PID files 2 | PUPPETMASTER_PID_DIR="/var/run/puppet" 3 | 4 | # Location of the main manifest 5 | #PUPPETMASTER_MANIFEST="/etc/puppet/manifests/site.pp" 6 | 7 | # Where to log general messages to. 8 | # Specify syslog to send log messages to the system log. 9 | #PUPPETMASTER_LOG="syslog" 10 | 11 | # You may specify other parameters to the puppetmaster here 12 | #PUPPETMASTER_EXTRA_OPTS="--no-ca" 13 | -------------------------------------------------------------------------------- /conf/gentoo/puppet/fileserver.conf: -------------------------------------------------------------------------------- 1 | # This file consists of arbitrarily named sections/modules 2 | # defining where files are served from and to whom 3 | 4 | # Define a section 'files' 5 | # Adapt the allow/deny settings to your needs. Order 6 | # for allow/deny does not matter, allow always takes precedence 7 | # over deny 8 | [files] 9 | path /var/lib/puppet/files 10 | # allow *.example.com 11 | # deny *.evil.example.com 12 | # allow 192.168.0.0/24 13 | -------------------------------------------------------------------------------- /conf/namespaceauth.conf: -------------------------------------------------------------------------------- 1 | # This is an example namespaceauth.conf file, 2 | # which you'll need if you want to start a client 3 | # in --listen mode. 4 | [fileserver] 5 | allow *.domain.com 6 | 7 | [puppetmaster] 8 | allow *.domain.com 9 | 10 | [puppetrunner] 11 | allow culain.domain.com 12 | 13 | [puppetbucket] 14 | allow *.domain.com 15 | 16 | [puppetreports] 17 | allow *.domain.com 18 | 19 | [resource] 20 | allow server.domain.com 21 | -------------------------------------------------------------------------------- /conf/puppet-queue.conf: -------------------------------------------------------------------------------- 1 | :daemon: true 2 | :working_dir: /tmp/stompserver 3 | :storage: .queue 4 | :queue: file 5 | :auth: false 6 | :debug: false 7 | :group: 8 | :user: 9 | :host: 127.0.0.1 10 | :port: 61613 11 | -------------------------------------------------------------------------------- /conf/redhat/client.sysconfig: -------------------------------------------------------------------------------- 1 | # The puppetmaster server 2 | #PUPPET_SERVER=puppet 3 | 4 | # If you wish to specify the port to connect to do so here 5 | #PUPPET_PORT=8140 6 | 7 | # Where to log to. Specify syslog to send log messages to the system log. 8 | #PUPPET_LOG=/var/log/puppet/puppet.log 9 | 10 | # You may specify other parameters to the puppet client here 11 | #PUPPET_EXTRA_OPTS=--waitforcert=500 12 | -------------------------------------------------------------------------------- /conf/redhat/fileserver.conf: -------------------------------------------------------------------------------- 1 | # This file consists of arbitrarily named sections/modules 2 | # defining where files are served from and to whom 3 | 4 | # Define a section 'files' 5 | # Adapt the allow/deny settings to your needs. Order 6 | # for allow/deny does not matter, allow always takes precedence 7 | # over deny 8 | # [files] 9 | # path /var/lib/puppet/files 10 | # allow *.example.com 11 | # deny *.evil.example.com 12 | # allow 192.168.0.0/24 13 | -------------------------------------------------------------------------------- /conf/redhat/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/puppet/*log { 2 | missingok 3 | notifempty 4 | create 0644 puppet puppet 5 | sharedscripts 6 | postrotate 7 | [ -e /etc/init.d/puppetmaster ] && /etc/init.d/puppetmaster condrestart >/dev/null 2>&1 || true 8 | [ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true 9 | endscript 10 | } 11 | -------------------------------------------------------------------------------- /conf/solaris/pkginfo: -------------------------------------------------------------------------------- 1 | PKG=CSWpuppet 2 | NAME=puppet - System Automation Framework 3 | VERSION=2.7.2 4 | CATEGORY=application 5 | VENDOR=http://projects.puppetlabs.com/projects/puppet 6 | EMAIL=luke@puppetlabs.com 7 | -------------------------------------------------------------------------------- /conf/suse/fileserver.conf: -------------------------------------------------------------------------------- 1 | # This file consists of arbitrarily named sections/modules 2 | # defining where files are served from and to whom 3 | 4 | # Define a section 'files' 5 | # Adapt the allow/deny settings to your needs. Order 6 | # for allow/deny does not matter, allow always takes precedence 7 | # over deny 8 | # [files] 9 | # path /var/lib/puppet/files 10 | # allow *.example.com 11 | # deny *.evil.example.com 12 | # allow 192.168.0.0/24 13 | -------------------------------------------------------------------------------- /conf/suse/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/puppet/*log { 2 | missingok 3 | notifempty 4 | create 0644 puppet puppet 5 | sharedscripts 6 | postrotate 7 | [ -e /etc/init.d/puppetmaster ] && /etc/init.d/puppetmaster condrestart >/dev/null 2>&1 || true 8 | [ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true 9 | endscript 10 | } 11 | -------------------------------------------------------------------------------- /examples/allatonce: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define thingie { 4 | file { "/tmp/classtest": ensure => file, mode => 755 } 5 | #testing {} 6 | } 7 | 8 | class testing { 9 | thingie { "componentname": } 10 | } 11 | 12 | #component {} 13 | testing { "testingname": } 14 | -------------------------------------------------------------------------------- /examples/assignments: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $goodness = sunos 4 | 5 | $subvariable = $goodness 6 | 7 | $yayness = "this is a string of text" 8 | 9 | #$sleeper = service { sleeper: 10 | # running => "1" 11 | #} 12 | -------------------------------------------------------------------------------- /examples/etc/otherfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/examples/etc/otherfile -------------------------------------------------------------------------------- /examples/etc/puppet/fileserver.conf: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | [dist] 4 | path /dist 5 | allow *.puppetlabs.com 6 | 7 | [plugins] 8 | path /var/lib/puppet/plugins 9 | allow *.puppetlabs.com 10 | 11 | [facts] 12 | path /var/lib/puppet/facts 13 | allow *.puppetlabs.com 14 | -------------------------------------------------------------------------------- /examples/etc/puppet/namespaceauth.conf: -------------------------------------------------------------------------------- 1 | # This file is only necessary if your clients listen. 2 | # Note that it affects all puppet daemons, including puppetmasterd, 3 | # which is why puppetmaster is in there. 4 | [fileserver] 5 | allow *.madstop.com 6 | 7 | [puppetmaster] 8 | allow *.madstop.com 9 | 10 | [pelementserver] 11 | allow puppet.madstop.com 12 | 13 | [puppetrunner] 14 | allow culain.madstop.com 15 | 16 | [puppetbucket] 17 | allow *.madstop.com 18 | 19 | [puppetreports] 20 | allow *.madstop.com 21 | -------------------------------------------------------------------------------- /examples/etc/puppet/puppet.conf: -------------------------------------------------------------------------------- 1 | [puppetd] 2 | report = true 3 | factsync = true 4 | pluginsync = true 5 | 6 | [puppetmasterd] 7 | reports = store,rrdgraph,tagmail,log 8 | node_terminus = ldap 9 | ldapserver = culain.madstop.com 10 | ldapbase = dc=madstop,dc=com 11 | -------------------------------------------------------------------------------- /examples/etc/puppet/tagmail.conf: -------------------------------------------------------------------------------- 1 | all: user@domain.com 2 | -------------------------------------------------------------------------------- /examples/execs: -------------------------------------------------------------------------------- 1 | $path = "/usr/bin:/bin" 2 | 3 | exec { "mkdir -p /tmp/fakedir": 4 | path => $path 5 | } 6 | 7 | exec { "rm -rf /tmp/fakedir": 8 | path => $path 9 | } 10 | 11 | exec { "touch /this/directory/does/not/exist": 12 | path => $path, 13 | returns => 1 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/file.bl: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { 4 | "/tmp/atest": ensure => file, mode => 755; 5 | "/tmp/btest": ensure => file, mode => 755 6 | } 7 | 8 | file { 9 | "/tmp/ctest": ensure => file; 10 | "/tmp/dtest": ensure => file; 11 | } 12 | -------------------------------------------------------------------------------- /examples/filedefaults: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | File { 4 | mode => 755, 5 | recurse => true 6 | } 7 | 8 | file { "/tmp/filedefaultstest": 9 | ensure => file 10 | } 11 | -------------------------------------------------------------------------------- /examples/filerecursion: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { "/tmp/dirtest/b/a": 4 | mode => 755, 5 | } 6 | 7 | file { "/tmp/dirtest": 8 | mode => 755, 9 | recurse => true, 10 | } 11 | 12 | file { "/tmp/dirtest/b/b": 13 | mode => 644, 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples/functions: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $yaytest = fact("operatingsystem") 4 | -------------------------------------------------------------------------------- /examples/groups: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | # there need to be two forms of adding to groups: 4 | # add the current host to a group, and add a list of hosts to a 5 | # group by name 6 | 7 | $group = "crap" 8 | -------------------------------------------------------------------------------- /examples/importing: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | #import "groups" 4 | # testing import loops 5 | import "importing" 6 | 7 | $name = "value" 8 | $system = $operatingsystem 9 | -------------------------------------------------------------------------------- /examples/mac_automount.pp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env puppet 2 | # Jeff McCune 3 | # 4 | # Apple's Automounter spawns a child that sends the parent 5 | # a SIGTERM. This makes it *very* difficult to figure out 6 | # if the process started correctly or not. 7 | # 8 | 9 | service {"automount-test": 10 | provider => base, 11 | hasrestart => false, 12 | pattern => '/tmp/hometest', 13 | start => "/usr/sbin/automount -m /tmp/home /dev/null -mnt /tmp/hometest", 14 | stop => "ps auxww | grep '/tmp/hometest' | grep -v grep | awk '{print \$2}' | xargs kill", 15 | ensure => running 16 | } 17 | -------------------------------------------------------------------------------- /examples/mac_dscl_revert.pp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env puppet --debug --verbose --trace 2 | # 3 | # Jeff McCune: I use this for developing and testing the directory service 4 | # provider. 5 | 6 | User { provider => "directoryservice" } 7 | Group { provider => "directoryservice" } 8 | 9 | user { 10 | "testgone": 11 | ensure => absent, 12 | uid => 550; 13 | "testhere": 14 | ensure => absent, 15 | uid => 551; 16 | } 17 | 18 | group { 19 | "testgone": 20 | ensure => absent, 21 | gid => 550; 22 | "testhere": 23 | ensure => absent, 24 | gid => 551; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /examples/mac_pkgdmg.pp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env puppet 2 | # 3 | 4 | package 5 | { 6 | "Foobar.pkg.dmg": ensure => present, provider => pkgdmg; 7 | } 8 | -------------------------------------------------------------------------------- /examples/mcx_dock_absent.pp: -------------------------------------------------------------------------------- 1 | mcx { '/Groups/mcx_dock': 2 | ensure => 'absent', 3 | content => 'absent' 4 | } 5 | -------------------------------------------------------------------------------- /examples/mcx_dock_invalid.pp: -------------------------------------------------------------------------------- 1 | # Mac MCX Test 2 | 3 | computer { "localhost": } 4 | 5 | mcx { 6 | "/Groups/mcx_dock": 7 | ensure => "present", 8 | content => 'invalid plist' 9 | } 10 | -------------------------------------------------------------------------------- /examples/mcx_notexists_absent.pp: -------------------------------------------------------------------------------- 1 | mcx { '/Groups/foobar': 2 | ensure => 'absent', 3 | content => 'absent' 4 | } 5 | -------------------------------------------------------------------------------- /examples/modules/sample-module.pp: -------------------------------------------------------------------------------- 1 | # Jeff McCune 2 | # 2007-08-14 3 | # 4 | # Use: 5 | # puppet --verbose --debug --modulepath=`pwd` ./sample-module.pp 6 | # 7 | # sample-module demonstrates the use of a custom language function 8 | # included within the module bundle. 9 | 10 | include sample-module 11 | -------------------------------------------------------------------------------- /examples/modules/sample-module/README.txt: -------------------------------------------------------------------------------- 1 | Jeff McCune 2 | 2007-08-14 3 | 4 | This small, sample module demonstrates how to extend the puppet language 5 | with a new parser function. 6 | 7 | See: 8 | manifests/init.pp 9 | lib/puppet/parser/functions/hostname_to_dn.rb 10 | templates/sample.erb 11 | 12 | Note the consistent naming of files for Puppet::Util::Autoload 13 | 14 | Reference Documents: 15 | http://docs.puppetlabs.com/guides/modules.html 16 | http://docs.puppetlabs.com/guides/custom_functions.html 17 | http://docs.puppetlabs.com/references/latest/function.html 18 | -------------------------------------------------------------------------------- /examples/modules/sample-module/manifests/init.pp: -------------------------------------------------------------------------------- 1 | # Jeff McCune 2 | # 3 | # Demonstration of a custom parser function and erb template within 4 | # a module, working in concert. 5 | 6 | class sample-module { 7 | $fqdn_to_dn = hostname_to_dn($domain) 8 | $sample_template = template("sample-module/sample.erb") 9 | 10 | notice("hostname_to_dn module function returned: [$fqdn_to_dn]") 11 | info("sample.erb looks like:\n$sample_template") 12 | } 13 | -------------------------------------------------------------------------------- /examples/modules/sample-module/templates/sample.erb: -------------------------------------------------------------------------------- 1 | 2 | ## Jeff McCune 3 | fqdn: <%= fqdn %> 4 | basedn: <%= fqdn_to_dn %> 5 | ## end sample.erb ## 6 | -------------------------------------------------------------------------------- /examples/nodes: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | # define nodes 4 | 5 | #service.setpath("../examples/root/etc/init.d") 6 | 7 | Service { 8 | path => "../examples/root/etc/init.d" 9 | } 10 | 11 | import "classing" 12 | 13 | sleepserver { 14 | path => $operatingsystem ? { 15 | sunos => "../examples/root/etc/configfile", 16 | hpux => "../examples/other/etc/configfile", 17 | default => "../examples/root/etc/configfile" 18 | }, 19 | schedule => true 20 | } 21 | -------------------------------------------------------------------------------- /examples/one: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | # this service doesn't actually exist, so we noop it 4 | # and this way, we can test noop :) 5 | service { "funtest": 6 | running => "0", 7 | noop => true 8 | } 9 | -------------------------------------------------------------------------------- /examples/selectors: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | # 3 | 4 | $platform = SunOS 5 | 6 | $funtest = $platform ? { 7 | SunOS => yayness, 8 | AIX => goodness, 9 | default => badness 10 | } 11 | 12 | # this is a comment 13 | 14 | $filename = "/tmp/yayness" 15 | 16 | $sleeper = file { $filename: 17 | mode => $platform ? { 18 | SunOS => 644, 19 | default => 755 20 | }, 21 | create => $platform ? "SunOS" => true 22 | } 23 | 24 | # i guess it has to be solved this way... 25 | 26 | #$platform ? sunos => file { $filename: 27 | # mode => 644 28 | #} 29 | -------------------------------------------------------------------------------- /examples/simpletests: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { 4 | "/tmp/atest": ensure => file; 5 | "/tmp/btest": ensure => file 6 | } 7 | 8 | file { 9 | "/tmp/ctest": ensure => file; 10 | "/tmp/dtest": ensure => file; 11 | } 12 | -------------------------------------------------------------------------------- /examples/svncommit: -------------------------------------------------------------------------------- 1 | $path = "/usr/bin:/bin" 2 | 3 | file { "/tmp/svntests": 4 | recurse => true, 5 | checksum => md5 6 | } 7 | 8 | exec { "echo 'files have been updated'": 9 | cwd => "/tmp/svntests", 10 | refreshonly => true, 11 | require => file["/tmp/svntests"], 12 | path => $path 13 | } 14 | -------------------------------------------------------------------------------- /ext/autotest/Rakefile: -------------------------------------------------------------------------------- 1 | dest = File.expand_path("~/.autotest") 2 | file dest => ["config", "Rakefile"] do 3 | sh "cp config #{dest}" 4 | end 5 | 6 | task :install => dest 7 | 8 | task :default => :install 9 | -------------------------------------------------------------------------------- /ext/emacs/puppet-mode-init.el: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; Setup puppet-mode for autoloading 3 | ;; 4 | (autoload 'puppet-mode "puppet-mode" "Major mode for editing puppet manifests") 5 | 6 | (add-to-list 'auto-mode-alist '("\\.pp$" . puppet-mode)) 7 | -------------------------------------------------------------------------------- /ext/pure_ruby_dsl/dsl_test.rb: -------------------------------------------------------------------------------- 1 | hostclass "foobar" do 2 | notify "this is a test", "loglevel" => "warning" 3 | end 4 | 5 | node "default" do 6 | acquire "foobar" 7 | end 8 | -------------------------------------------------------------------------------- /ext/rack/files/config.ru: -------------------------------------------------------------------------------- 1 | # a config.ru, for use with every rack-compatible webserver. 2 | # SSL needs to be handled outside this, though. 3 | 4 | # if puppet is not in your RUBYLIB: 5 | # $:.unshift('/opt/puppet/lib') 6 | 7 | $0 = "master" 8 | 9 | # if you want debugging: 10 | # ARGV << "--debug" 11 | 12 | ARGV << "--rack" 13 | require 'puppet/application/master' 14 | # we're usually running inside a Rack::Builder.new {} block, 15 | # therefore we need to call run *here*. 16 | run Puppet::Application[:master].run 17 | -------------------------------------------------------------------------------- /ext/regexp_nodes/classes/databases: -------------------------------------------------------------------------------- 1 | db\d{2} 2 | mysql 3 | -------------------------------------------------------------------------------- /ext/regexp_nodes/classes/webservers: -------------------------------------------------------------------------------- 1 | ^(web|www) 2 | leterel 3 | -------------------------------------------------------------------------------- /ext/regexp_nodes/parameters/environment/prod: -------------------------------------------------------------------------------- 1 | \d{3}$ 2 | -------------------------------------------------------------------------------- /ext/regexp_nodes/parameters/environment/qa: -------------------------------------------------------------------------------- 1 | ^qa- 2 | ^qa2- 3 | ^qa3- 4 | -------------------------------------------------------------------------------- /ext/vim/README: -------------------------------------------------------------------------------- 1 | To install these files, copy them into ~/.vim, or the relevant 2 | system-wide location. To use the ftplugin and indenting, you may need 3 | to enable them with "filetype plugin indent on" in your vimrc. 4 | -------------------------------------------------------------------------------- /ext/vim/ftdetect/puppet.vim: -------------------------------------------------------------------------------- 1 | " detect puppet filetype 2 | au BufRead,BufNewFile *.pp set filetype=puppet 3 | -------------------------------------------------------------------------------- /lib/puppet/application/ca.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | 3 | class Puppet::Application::Ca < Puppet::Application::FaceBase 4 | run_mode :master 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/application/catalog.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Catalog < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/certificate.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Certificate < Puppet::Application::IndirectionBase 4 | def setup 5 | location = Puppet::SSL::Host.ca_location 6 | if location == :local && !Puppet::SSL::CertificateAuthority.ca? 7 | self.class.run_mode("master") 8 | self.set_run_mode self.class.run_mode 9 | end 10 | 11 | super 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/puppet/application/certificate_request.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Certificate_request < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/certificate_revocation_list.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Certificate_revocation_list < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/config.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | 3 | class Puppet::Application::Config < Puppet::Application::FaceBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/facts.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Facts < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/file.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::File < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/help.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | 3 | class Puppet::Application::Help < Puppet::Application::FaceBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/indirection_base.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | 3 | class Puppet::Application::IndirectionBase < Puppet::Application::FaceBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/key.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Key < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/man.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | 3 | class Puppet::Application::Man < Puppet::Application::FaceBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/node.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Node < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/parser.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | require 'puppet/face' 3 | 4 | class Puppet::Application::Parser < Puppet::Application::FaceBase 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/application/plugin.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | class Puppet::Application::Plugin < Puppet::Application::FaceBase 3 | end 4 | -------------------------------------------------------------------------------- /lib/puppet/application/report.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Report < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/resource_type.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Resource_type < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/application/secret_agent.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/face_base' 2 | require 'puppet/face' 3 | 4 | class Puppet::Application::Secret_agent < Puppet::Application::FaceBase 5 | run_mode :agent 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/application/status.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/application/indirection_base' 2 | 3 | class Puppet::Application::Status < Puppet::Application::IndirectionBase 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/dsl.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | 3 | module Puppet::DSL 4 | end 5 | 6 | require 'puppet/dsl/resource_type_api' 7 | require 'puppet/dsl/resource_api' 8 | -------------------------------------------------------------------------------- /lib/puppet/external/base64.rb: -------------------------------------------------------------------------------- 1 | # a stupid hack class to get rid of all of the warnings but 2 | # still make the encode/decode methods available 3 | 4 | # 1.8.2 has a Base64 class, but 1.8.1 just imports the methods directly 5 | # into Object 6 | 7 | require 'base64' 8 | 9 | unless defined?(Base64) 10 | class Base64 11 | def Base64.encode64(*args) 12 | Object.method(:encode64).call(*args) 13 | end 14 | 15 | def Base64.decode64(*args) 16 | Object.method(:decode64).call(*args) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/puppet/external/dot.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/lib/puppet/external/dot.rb -------------------------------------------------------------------------------- /lib/puppet/external/event-loop.rb: -------------------------------------------------------------------------------- 1 | require "puppet/external/event-loop/event-loop" 2 | -------------------------------------------------------------------------------- /lib/puppet/external/nagios/makefile: -------------------------------------------------------------------------------- 1 | all: parser.rb 2 | 3 | debug: parser.rb setdebug 4 | 5 | parser.rb: grammar.ry 6 | racc -E -oparser.rb grammar.ry 7 | 8 | setdebug: 9 | perl -pi -e 's{\@yydebug =.*$$}{\@yydebug = true}' parser.rb 10 | -------------------------------------------------------------------------------- /lib/puppet/external/pson/version.rb: -------------------------------------------------------------------------------- 1 | module PSON 2 | # PSON version 3 | VERSION = '1.1.9' 4 | VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc: 5 | VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc: 6 | VERSION_MINOR = VERSION_ARRAY[1] # :nodoc: 7 | VERSION_BUILD = VERSION_ARRAY[2] # :nodoc: 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/face.rb: -------------------------------------------------------------------------------- 1 | # The public name of this feature is 'face', but we have hidden all the 2 | # plumbing over in the 'interfaces' namespace to make clear the distinction 3 | # between the two. 4 | # 5 | # This file exists to ensure that the public name is usable without revealing 6 | # the details of the implementation; you really only need go look at anything 7 | # under Interfaces if you are looking to extend the implementation. 8 | # 9 | # It isn't hidden to gratuitously hide things, just to make it easier to 10 | # separate out the interests people will have. --daniel 2011-04-07 11 | require 'puppet/interface' 12 | Puppet::Face = Puppet::Interface 13 | -------------------------------------------------------------------------------- /lib/puppet/face/file/store.rb: -------------------------------------------------------------------------------- 1 | # Store a specified file in our filebucket. 2 | Puppet::Face.define(:file, '0.0.1') do 3 | action :store do |*args| 4 | summary "Store a file in the local filebucket." 5 | arguments "" 6 | returns "Nothing." 7 | examples <<-EOT 8 | Store a file: 9 | 10 | $ puppet file store /root/.bashrc 11 | EOT 12 | 13 | when_invoked do |path, options| 14 | file = Puppet::FileBucket::File.new(File.read(path)) 15 | 16 | Puppet::FileBucket::File.indirection.terminus_class = :file 17 | Puppet::FileBucket::File.indirection.save file 18 | file.checksum 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/puppet/face/key.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/face' 2 | 3 | Puppet::Indirector::Face.define(:key, '0.0.1') do 4 | copyright "Puppet Labs", 2011 5 | license "Apache 2 license; see COPYING" 6 | 7 | summary "Create, save, and remove certificate keys." 8 | description <<-'EOT' 9 | This subcommand manages certificate private keys. Keys are created 10 | automatically by puppet agent and when certificate requests are generated 11 | with 'puppet certificate generate'; it should not be necessary to use this 12 | subcommand directly. 13 | EOT 14 | 15 | end 16 | -------------------------------------------------------------------------------- /lib/puppet/feature/pson.rb: -------------------------------------------------------------------------------- 1 | Puppet.features.add(:pson) do 2 | require 'puppet/external/pson/common' 3 | require 'puppet/external/pson/version' 4 | require 'puppet/external/pson/pure' 5 | true 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/feature/rack.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/feature' 2 | 3 | # See if we have rack available, an HTTP Application Stack 4 | # Explicitly depend on rack library version >= 1.0.0 5 | Puppet.features.add(:rack) do 6 | begin 7 | require 'rack' 8 | rescue LoadError => detail 9 | require 'rubygems' 10 | require 'rack' 11 | end 12 | 13 | if ! (defined?(::Rack) and defined?(::Rack.release)) 14 | false 15 | else 16 | major_version = ::Rack.release.split('.')[0].to_i 17 | if major_version >= 1 18 | true 19 | else 20 | false 21 | end 22 | end 23 | end 24 | 25 | -------------------------------------------------------------------------------- /lib/puppet/feature/rubygems.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/feature' 2 | 3 | Puppet.features.add(:rubygems, :libs => "rubygems") 4 | -------------------------------------------------------------------------------- /lib/puppet/feature/selinux.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/feature' 2 | 3 | Puppet.features.add(:selinux, :libs => ["selinux"]) 4 | -------------------------------------------------------------------------------- /lib/puppet/feature/ssh.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/feature' 2 | 3 | Puppet.features.rubygems? 4 | Puppet.features.add(:ssh, :libs => %{net/ssh}) 5 | -------------------------------------------------------------------------------- /lib/puppet/feature/stomp.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/feature' 2 | 3 | # We want this to load if possible, but it's not automatically 4 | # required. 5 | Puppet.features.rubygems? 6 | Puppet.features.add(:stomp, :libs => %{stomp}) 7 | -------------------------------------------------------------------------------- /lib/puppet/feature/zlib.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/feature' 2 | 3 | # We want this to load if possible, but it's not automatically 4 | # required. 5 | Puppet.features.rubygems? 6 | Puppet.features.add(:zlib, :libs => %{zlib}) 7 | -------------------------------------------------------------------------------- /lib/puppet/file_bucket.rb: -------------------------------------------------------------------------------- 1 | # stub 2 | module Puppet::FileBucket 3 | class BucketError < RuntimeError; end 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/file_bucket/file/indirection_hooks.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_bucket/file' 2 | 3 | # This module is used to pick the appropriate terminus 4 | # in filebucket indirections. 5 | module Puppet::FileBucket::File::IndirectionHooks 6 | def select_terminus(request) 7 | return(request.protocol == 'https' ? :rest : Puppet::FileBucket::File.indirection.terminus_class) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/file_collection/lookup.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_collection' 2 | 3 | # A simple module for looking up file paths and indexes 4 | # in a file collection. 5 | module Puppet::FileCollection::Lookup 6 | attr_accessor :line, :file_index 7 | 8 | def file_collection 9 | Puppet::FileCollection.collection 10 | end 11 | 12 | def file=(path) 13 | @file_index = file_collection.index(path) 14 | end 15 | 16 | def file 17 | return nil unless file_index 18 | file_collection.path(file_index) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/puppet/file_serving.rb: -------------------------------------------------------------------------------- 1 | # Just a stub class. 2 | class Puppet::FileServing # :nodoc: 3 | end 4 | -------------------------------------------------------------------------------- /lib/puppet/indirector/active_record.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector' 2 | 3 | class Puppet::Indirector::ActiveRecord < Puppet::Indirector::Terminus 4 | class << self 5 | attr_accessor :ar_model 6 | end 7 | 8 | def self.use_ar_model(klass) 9 | self.ar_model = klass 10 | end 11 | 12 | def ar_model 13 | self.class.ar_model 14 | end 15 | 16 | def initialize 17 | Puppet::Rails.init 18 | end 19 | 20 | def find(request) 21 | return nil unless instance = ar_model.find_by_name(request.key) 22 | instance.to_puppet 23 | end 24 | 25 | def save(request) 26 | ar_model.from_puppet(request.instance).save 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/puppet/indirector/catalog/queue.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource/catalog' 2 | require 'puppet/indirector/queue' 3 | 4 | class Puppet::Resource::Catalog::Queue < Puppet::Indirector::Queue 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/catalog/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource/catalog' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::Resource::Catalog::Rest < Puppet::Indirector::REST 5 | desc "Find resource catalogs over HTTP via REST." 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/indirector/catalog/store_configs.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/store_configs' 2 | require 'puppet/resource/catalog' 3 | 4 | class Puppet::Resource::Catalog::StoreConfigs < Puppet::Indirector::StoreConfigs 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/catalog/yaml.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource/catalog' 2 | require 'puppet/indirector/yaml' 3 | 4 | class Puppet::Resource::Catalog::Yaml < Puppet::Indirector::Yaml 5 | desc "Store catalogs as flat files, serialized using YAML." 6 | 7 | private 8 | 9 | # Override these, because yaml doesn't want to convert our self-referential 10 | # objects. This is hackish, but eh. 11 | def from_yaml(text) 12 | if config = YAML.load(text) 13 | return config 14 | end 15 | end 16 | 17 | def to_yaml(config) 18 | # We can't yaml-dump classes. 19 | #config.edgelist_class = nil 20 | YAML.dump(config) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate/ca.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/ssl_file' 2 | require 'puppet/ssl/certificate' 3 | 4 | class Puppet::SSL::Certificate::Ca < Puppet::Indirector::SslFile 5 | desc "Manage the CA collection of signed SSL certificates on disk." 6 | 7 | store_in :signeddir 8 | store_ca_at :cacert 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate/file.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/ssl_file' 2 | require 'puppet/ssl/certificate' 3 | 4 | class Puppet::SSL::Certificate::File < Puppet::Indirector::SslFile 5 | desc "Manage SSL certificates on disk." 6 | 7 | store_in :certdir 8 | store_ca_at :localcacert 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/ssl/certificate' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::SSL::Certificate::Rest < Puppet::Indirector::REST 5 | desc "Find and save certificates over HTTP via REST." 6 | 7 | use_server_setting(:ca_server) 8 | use_port_setting(:ca_port) 9 | 10 | def find(request) 11 | return nil unless result = super 12 | result.name = request.key unless result.name == request.key 13 | result 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_request/file.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/ssl_file' 2 | require 'puppet/ssl/certificate_request' 3 | 4 | class Puppet::SSL::CertificateRequest::File < Puppet::Indirector::SslFile 5 | desc "Manage the collection of certificate requests on disk." 6 | 7 | store_in :requestdir 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_request/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/ssl/certificate_request' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::SSL::CertificateRequest::Rest < Puppet::Indirector::REST 5 | desc "Find and save certificate requests over HTTP via REST." 6 | 7 | use_server_setting(:ca_server) 8 | use_port_setting(:ca_port) 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_revocation_list/ca.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/ssl_file' 2 | require 'puppet/ssl/certificate_revocation_list' 3 | 4 | class Puppet::SSL::CertificateRevocationList::Ca < Puppet::Indirector::SslFile 5 | desc "Manage the CA collection of certificate requests on disk." 6 | 7 | store_at :cacrl 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_revocation_list/file.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/ssl_file' 2 | require 'puppet/ssl/certificate_revocation_list' 3 | 4 | class Puppet::SSL::CertificateRevocationList::File < Puppet::Indirector::SslFile 5 | desc "Manage the global certificate revocation list." 6 | 7 | store_at :hostcrl 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_revocation_list/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/ssl/certificate_revocation_list' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::SSL::CertificateRevocationList::Rest < Puppet::Indirector::REST 5 | desc "Find and save certificate revocation lists over HTTP via REST." 6 | 7 | use_server_setting(:ca_server) 8 | use_port_setting(:ca_port) 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_status.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector' 2 | 3 | class Puppet::Indirector::CertificateStatus 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/indirector/certificate_status/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/ssl/host' 2 | require 'puppet/indirector/rest' 3 | require 'puppet/indirector/certificate_status' 4 | 5 | class Puppet::Indirector::CertificateStatus::Rest < Puppet::Indirector::REST 6 | desc "Sign, revoke, search for, or clean certificates & certificate requests over HTTP." 7 | 8 | use_server_setting(:ca_server) 9 | use_port_setting(:ca_port) 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/indirector/code.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/terminus' 2 | 3 | # Do nothing, requiring that the back-end terminus do all 4 | # of the work. 5 | class Puppet::Indirector::Code < Puppet::Indirector::Terminus 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/indirector/direct_file_server.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/terminus_helper' 2 | require 'puppet/indirector/terminus' 3 | 4 | class Puppet::Indirector::DirectFileServer < Puppet::Indirector::Terminus 5 | 6 | include Puppet::FileServing::TerminusHelper 7 | 8 | def find(request) 9 | return nil unless FileTest.exists?(request.key) 10 | instance = model.new(request.key) 11 | instance.links = request.options[:links] if request.options[:links] 12 | instance 13 | end 14 | 15 | def search(request) 16 | return nil unless FileTest.exists?(request.key) 17 | path2instances(request, request.key) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/puppet/indirector/envelope.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector' 2 | 3 | # Provide any attributes or functionality needed for indirected 4 | # instances. 5 | module Puppet::Indirector::Envelope 6 | attr_accessor :expiration 7 | 8 | def expired? 9 | expiration and expiration < Time.now 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/puppet/indirector/facts/memory.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node/facts' 2 | require 'puppet/indirector/memory' 3 | 4 | class Puppet::Node::Facts::Memory < Puppet::Indirector::Memory 5 | desc "Keep track of facts in memory but nowhere else. This is used for 6 | one-time compiles, such as what the stand-alone `puppet` does. 7 | To use this terminus, you must load it with the data you want it 8 | to contain." 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/indirector/facts/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node/facts' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::Node::Facts::Rest < Puppet::Indirector::REST 5 | desc "Find and save facts about nodes over HTTP via REST." 6 | use_server_setting(:inventory_server) 7 | use_port_setting(:inventory_port) 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/indirector/facts/store_configs.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node/facts' 2 | require 'puppet/indirector/store_configs' 3 | 4 | class Puppet::Node::Facts::StoreConfigs < Puppet::Indirector::StoreConfigs 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_bucket_file/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/rest' 2 | require 'puppet/file_bucket/file' 3 | 4 | module Puppet::FileBucketFile 5 | class Rest < Puppet::Indirector::REST 6 | desc "This is a REST based mechanism to send/retrieve file to/from the filebucket" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_content.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/content' 2 | 3 | # A stub class, so our constants work. 4 | class Puppet::Indirector::FileContent # :nodoc: 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_content/file.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/content' 2 | require 'puppet/indirector/file_content' 3 | require 'puppet/indirector/direct_file_server' 4 | 5 | class Puppet::Indirector::FileContent::File < Puppet::Indirector::DirectFileServer 6 | desc "Retrieve file contents from disk." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_content/file_server.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/content' 2 | require 'puppet/indirector/file_content' 3 | require 'puppet/indirector/file_server' 4 | 5 | class Puppet::Indirector::FileContent::FileServer < Puppet::Indirector::FileServer 6 | desc "Retrieve file contents using Puppet's fileserver." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_content/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/content' 2 | require 'puppet/indirector/file_content' 3 | require 'puppet/indirector/rest' 4 | 5 | class Puppet::Indirector::FileContent::Rest < Puppet::Indirector::REST 6 | desc "Retrieve file contents via a REST HTTP interface." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_metadata.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/metadata' 2 | 3 | # A stub class, so our constants work. 4 | class Puppet::Indirector::FileMetadata # :nodoc: 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_metadata/file.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/metadata' 2 | require 'puppet/indirector/file_metadata' 3 | require 'puppet/indirector/direct_file_server' 4 | 5 | class Puppet::Indirector::FileMetadata::File < Puppet::Indirector::DirectFileServer 6 | desc "Retrieve file metadata directly from the local filesystem." 7 | 8 | def find(request) 9 | return unless data = super 10 | data.collect 11 | 12 | data 13 | end 14 | 15 | def search(request) 16 | return unless result = super 17 | 18 | result.each { |instance| instance.collect } 19 | 20 | result 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_metadata/file_server.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/metadata' 2 | require 'puppet/indirector/file_metadata' 3 | require 'puppet/indirector/file_server' 4 | 5 | class Puppet::Indirector::FileMetadata::FileServer < Puppet::Indirector::FileServer 6 | desc "Retrieve file metadata using Puppet's fileserver." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/file_metadata/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/file_serving/metadata' 2 | require 'puppet/indirector/file_metadata' 3 | require 'puppet/indirector/rest' 4 | 5 | class Puppet::Indirector::FileMetadata::Rest < Puppet::Indirector::REST 6 | desc "Retrieve file metadata via a REST HTTP interface." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/key/ca.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/ssl_file' 2 | require 'puppet/ssl/key' 3 | 4 | class Puppet::SSL::Key::Ca < Puppet::Indirector::SslFile 5 | desc "Manage the CA's private on disk. This terminus *only* works 6 | with the CA key, because that's the only key that the CA ever interacts 7 | with." 8 | 9 | store_in :privatekeydir 10 | 11 | store_ca_at :cakey 12 | end 13 | -------------------------------------------------------------------------------- /lib/puppet/indirector/memory.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/terminus' 2 | 3 | # Manage a memory-cached list of instances. 4 | class Puppet::Indirector::Memory < Puppet::Indirector::Terminus 5 | def initialize 6 | @instances = {} 7 | end 8 | 9 | def destroy(request) 10 | raise ArgumentError.new("Could not find #{request.key} to destroy") unless @instances.include?(request.key) 11 | @instances.delete(request.key) 12 | end 13 | 14 | def find(request) 15 | @instances[request.key] 16 | end 17 | 18 | def save(request) 19 | @instances[request.key] = request.instance 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/puppet/indirector/node/active_record.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/rails/host' 2 | require 'puppet/indirector/active_record' 3 | require 'puppet/node' 4 | 5 | class Puppet::Node::ActiveRecord < Puppet::Indirector::ActiveRecord 6 | use_ar_model Puppet::Rails::Host 7 | 8 | def find(request) 9 | node = super 10 | node.fact_merge 11 | node 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/puppet/indirector/node/memory.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node' 2 | require 'puppet/indirector/memory' 3 | 4 | class Puppet::Node::Memory < Puppet::Indirector::Memory 5 | desc "Keep track of nodes in memory but nowhere else. This is used for 6 | one-time compiles, such as what the stand-alone `puppet` does. 7 | To use this terminus, you must load it with the data you want it 8 | to contain; it is only useful for developers and should generally not 9 | be chosen by a normal user." 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/indirector/node/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::Node::Rest < Puppet::Indirector::REST 5 | desc "This will eventually be a REST-based mechanism for finding nodes. It is currently non-functional." 6 | # TODO/FIXME 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/node/store_configs.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/store_configs' 2 | require 'puppet/node' 3 | 4 | class Puppet::Node::StoreConfigs < Puppet::Indirector::StoreConfigs 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/node/yaml.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node' 2 | require 'puppet/indirector/yaml' 3 | 4 | class Puppet::Node::Yaml < Puppet::Indirector::Yaml 5 | desc "Store node information as flat files, serialized using YAML, 6 | or deserialize stored YAML nodes." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/plain.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/terminus' 2 | 3 | # An empty terminus type, meant to just return empty objects. 4 | class Puppet::Indirector::Plain < Puppet::Indirector::Terminus 5 | # Just return nothing. 6 | def find(request) 7 | indirection.model.new(request.key) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/indirector/report/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/rest' 2 | 3 | class Puppet::Transaction::Report::Rest < Puppet::Indirector::REST 4 | desc "Get server report over HTTP via REST." 5 | use_server_setting(:report_server) 6 | use_port_setting(:report_port) 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/report/yaml.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/transaction/report' 2 | require 'puppet/indirector/yaml' 3 | 4 | class Puppet::Transaction::Report::Yaml < Puppet::Indirector::Yaml 5 | desc "Store last report as a flat file, serialized using YAML." 6 | 7 | # Force report to be saved there 8 | def path(name,ext='.yaml') 9 | Puppet[:lastrunreport] 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/puppet/indirector/resource/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/status' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::Resource::Rest < Puppet::Indirector::REST 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/resource/store_configs.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/store_configs' 2 | class Puppet::Resource::StoreConfigs < Puppet::Indirector::StoreConfigs 3 | end 4 | -------------------------------------------------------------------------------- /lib/puppet/indirector/resource_type.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource/type' 2 | 3 | # A stub class, so our constants work. 4 | class Puppet::Indirector::ResourceType # :nodoc: 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/indirector/resource_type/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource/type' 2 | require 'puppet/indirector/rest' 3 | require 'puppet/indirector/resource_type' 4 | 5 | class Puppet::Indirector::ResourceType::Rest < Puppet::Indirector::REST 6 | desc "Retrieve resource types via a REST HTTP interface." 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/run/local.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/run' 2 | require 'puppet/indirector/code' 3 | 4 | class Puppet::Run::Local < Puppet::Indirector::Code 5 | def save( request ) 6 | request.instance.run 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/indirector/run/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/run' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::Run::Rest < Puppet::Indirector::REST 5 | desc "Trigger Agent runs via REST." 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/indirector/status.rb: -------------------------------------------------------------------------------- 1 | # A stub class, so our constants work. 2 | class Puppet::Indirector::Status 3 | end 4 | -------------------------------------------------------------------------------- /lib/puppet/indirector/status/local.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/status' 2 | 3 | class Puppet::Indirector::Status::Local < Puppet::Indirector::Code 4 | def find( *anything ) 5 | model.new 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/indirector/status/rest.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector/status' 2 | require 'puppet/indirector/rest' 3 | 4 | class Puppet::Indirector::Status::Rest < Puppet::Indirector::REST 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/network.rb: -------------------------------------------------------------------------------- 1 | # Just a stub, so we can correctly scope other classes. 2 | module Puppet::Network # :nodoc: 3 | end 4 | -------------------------------------------------------------------------------- /lib/puppet/network/client/file.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Network::Client::File < Puppet::Network::Client::ProxyClient 2 | @handler = Puppet::Network::Handler.handler(:fileserver) 3 | @drivername = :FileServer 4 | self.mkmethods 5 | end 6 | 7 | -------------------------------------------------------------------------------- /lib/puppet/network/client/runner.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Network::Client::Runner < Puppet::Network::Client::ProxyClient 2 | self.mkmethods 3 | 4 | def initialize(hash = {}) 5 | hash[:Runner] = self.class.handler.new if hash.include?(:Runner) 6 | 7 | super(hash) 8 | end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /lib/puppet/network/client/status.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Network::Client::Status < Puppet::Network::Client::ProxyClient 2 | self.mkmethods 3 | end 4 | 5 | -------------------------------------------------------------------------------- /lib/puppet/network/handler/status.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Network::Handler 2 | class Status < Handler 3 | desc "A simple interface for testing Puppet connectivity." 4 | 5 | side :client 6 | 7 | @interface = XMLRPC::Service::Interface.new("status") { |iface| 8 | iface.add_method("int status()") 9 | } 10 | 11 | def status(client = nil, clientip = nil) 12 | 1 13 | end 14 | end 15 | end 16 | 17 | -------------------------------------------------------------------------------- /lib/puppet/network/http.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Network::HTTP 2 | def self.server_class_by_type(kind) 3 | case kind.to_sym 4 | when :webrick 5 | require 'puppet/network/http/webrick' 6 | return Puppet::Network::HTTP::WEBrick 7 | when :mongrel 8 | raise ArgumentError, "Mongrel is not installed on this platform" unless Puppet.features.mongrel? 9 | require 'puppet/network/http/mongrel' 10 | return Puppet::Network::HTTP::Mongrel 11 | else 12 | raise ArgumentError, "Unknown HTTP server name [#{kind}]" 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/puppet/network/http/api.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/network/http' 2 | 3 | class Puppet::Network::HTTP::API 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/network/http/rack/httphandler.rb: -------------------------------------------------------------------------------- 1 | require 'openssl' 2 | require 'puppet/ssl/certificate' 3 | 4 | class Puppet::Network::HTTP::RackHttpHandler 5 | 6 | def initialize 7 | end 8 | 9 | # do something useful with request (a Rack::Request) and use 10 | # response to fill your Rack::Response 11 | def process(request, response) 12 | raise NotImplementedError, "Your RackHttpHandler subclass is supposed to override service(request)" 13 | end 14 | 15 | end 16 | 17 | -------------------------------------------------------------------------------- /lib/puppet/network/http_server.rb: -------------------------------------------------------------------------------- 1 | # Just a stub, so we can correctly scope other classes. 2 | module Puppet::Network::HTTPServer # :nodoc: 3 | end 4 | -------------------------------------------------------------------------------- /lib/puppet/network/rest_controller.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Network::RESTController # :nodoc: 2 | end 3 | -------------------------------------------------------------------------------- /lib/puppet/network/xmlrpc/server.rb: -------------------------------------------------------------------------------- 1 | require 'xmlrpc/server' 2 | require 'puppet/network/authorization' 3 | require 'puppet/network/xmlrpc/processor' 4 | 5 | module Puppet::Network 6 | # Most of our subclassing is just so that we can get 7 | # access to information from the request object, like 8 | # the client name and IP address. 9 | class XMLRPCServer < ::XMLRPC::BasicServer 10 | include Puppet::Util 11 | include Puppet::Network::XMLRPCProcessor 12 | 13 | def initialize 14 | super() 15 | setup_processor 16 | end 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /lib/puppet/node/inventory.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/node' 2 | require 'puppet/indirector' 3 | 4 | class Puppet::Node::Inventory 5 | extend Puppet::Indirector 6 | indirects :inventory, :terminus_setting => :inventory_terminus 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/parser.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/parser/parser' 2 | require 'puppet/parser/compiler' 3 | require 'puppet/resource/type_collection' 4 | 5 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/definition.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/parser/ast/top_level_construct' 2 | 3 | class Puppet::Parser::AST::Definition < Puppet::Parser::AST::TopLevelConstruct 4 | attr_accessor :context 5 | 6 | def initialize(name, context = {}, &ruby_code) 7 | @name = name 8 | @context = context 9 | @ruby_code = ruby_code 10 | end 11 | 12 | def instantiate(modname) 13 | new_definition = Puppet::Resource::Type.new(:definition, @name, @context.merge(:module_name => modname)) 14 | new_definition.ruby_code = @ruby_code if @ruby_code 15 | [new_definition] 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/else.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/parser/ast/branch' 2 | 3 | class Puppet::Parser::AST 4 | # A separate ElseIf statement; can function as an 'else' if there's no 5 | # test. 6 | class Else < AST::Branch 7 | 8 | associates_doc 9 | 10 | attr_accessor :statements 11 | 12 | def each 13 | yield @statements 14 | end 15 | 16 | # Evaluate the actual statements; this only gets called if 17 | # our test was true matched. 18 | def evaluate(scope) 19 | @statements.safeevaluate(scope) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/minus.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | require 'puppet/parser/ast/branch' 3 | 4 | # An object that returns a boolean which is the boolean not 5 | # of the given value. 6 | class Puppet::Parser::AST 7 | class Minus < AST::Branch 8 | attr_accessor :value 9 | 10 | def each 11 | yield @value 12 | end 13 | 14 | def evaluate(scope) 15 | val = @value.safeevaluate(scope) 16 | val = Puppet::Parser::Scope.number?(val) 17 | if val == nil 18 | raise ArgumentError, "minus operand #{val} is not a number" 19 | end 20 | -val 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/nop.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/parser/ast/branch' 2 | 3 | class Puppet::Parser::AST 4 | # This class is a no-op, it doesn't produce anything 5 | # when evaluated, hence it's name :-) 6 | class Nop < AST::Leaf 7 | def evaluate(scope) 8 | # nothing to do 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/not.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | require 'puppet/parser/ast/branch' 3 | 4 | # An object that returns a boolean which is the boolean not 5 | # of the given value. 6 | class Puppet::Parser::AST 7 | class Not < AST::Branch 8 | attr_accessor :value 9 | 10 | def each 11 | yield @value 12 | end 13 | 14 | def evaluate(scope) 15 | val = @value.safeevaluate(scope) 16 | ! Puppet::Parser::Scope.true?(val) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/resource_instance.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/parser/ast/branch' 2 | 3 | class Puppet::Parser::AST 4 | class ResourceInstance < Branch 5 | # A simple container for a parameter for an object. Consists of a 6 | # title and a set of parameters. 7 | attr_accessor :title, :parameters 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/parser/ast/top_level_construct.rb: -------------------------------------------------------------------------------- 1 | # The base class for AST nodes representing top level things: 2 | # hostclasses, definitions, and nodes. 3 | class Puppet::Parser::AST::TopLevelConstruct < Puppet::Parser::AST 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/fail.rb: -------------------------------------------------------------------------------- 1 | Puppet::Parser::Functions::newfunction(:fail, :doc => "Fail with a parse error.") do |vals| 2 | vals = vals.collect { |s| s.to_s }.join(" ") if vals.is_a? Array 3 | raise Puppet::ParseError, vals.to_s 4 | end 5 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/fqdn_rand.rb: -------------------------------------------------------------------------------- 1 | Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc => 2 | "Generates random numbers based on the node's fqdn. Generated random values 3 | will be a range from 0 up to and excluding n, where n is the first parameter. 4 | The second argument specifies a number to add to the seed and is optional, for example: 5 | 6 | $random_number = fqdn_rand(30) 7 | $random_number_seed = fqdn_rand(30,30)") do |args| 8 | require 'digest/md5' 9 | max = args.shift.to_i 10 | srand(Digest::MD5.hexdigest([self['::fqdn'],args].join(':')).hex) 11 | rand(max).to_s 12 | end 13 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/md5.rb: -------------------------------------------------------------------------------- 1 | Puppet::Parser::Functions::newfunction(:md5, :type => :rvalue, :doc => "Returns a MD5 hash value from a provided string.") do |args| 2 | require 'md5' 3 | 4 | Digest::MD5.hexdigest(args[0]) 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/search.rb: -------------------------------------------------------------------------------- 1 | Puppet::Parser::Functions::newfunction(:search, :doc => "Add another namespace for this class to search. 2 | This allows you to create classes with sets of definitions and add 3 | those classes to another class's search path.") do |vals| 4 | vals.each do |val| 5 | add_namespace(val) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/sha1.rb: -------------------------------------------------------------------------------- 1 | Puppet::Parser::Functions::newfunction(:sha1, :type => :rvalue, :doc => "Returns a SHA1 hash value from a provided string.") do |args| 2 | require 'digest/sha1' 3 | 4 | Digest::SHA1.hexdigest(args[0]) 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/tag.rb: -------------------------------------------------------------------------------- 1 | # Tag the current scope with each passed name 2 | Puppet::Parser::Functions::newfunction(:tag, :doc => "Add the specified tags to the containing class 3 | or definition. All contained objects will then acquire that tag, also. 4 | ") do |vals| 5 | self.resource.tag(*vals) 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/parser/makefile: -------------------------------------------------------------------------------- 1 | #parser.rb: grammar.ry 2 | # ryacc --output parser grammar 3 | 4 | parser.rb: grammar.ra 5 | racc -o$@ grammar.ra 6 | 7 | grammar.output: grammar.ra 8 | racc -v -o$@ grammar.ra 9 | -------------------------------------------------------------------------------- /lib/puppet/parser/yaml_trimmer.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Parser::YamlTrimmer 2 | REMOVE = %w{@scope @source} 3 | 4 | def to_yaml_properties 5 | r = instance_variables - REMOVE 6 | r -= skip_for_yaml if respond_to?(:skip_for_yaml) 7 | r 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/property/ordered_list.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/property/list' 2 | 3 | module Puppet 4 | class Property 5 | class OrderedList < List 6 | 7 | def add_should_with_current(should, current) 8 | if current.is_a?(Array) 9 | #tricky trick 10 | #Preserve all the current items in the list 11 | #but move them to the back of the line 12 | should = should + (current - should) 13 | end 14 | should 15 | end 16 | 17 | def dearrayify(array) 18 | array.join(delimiter) 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/puppet/provider/cisco.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/network_device/cisco/device' 2 | require 'puppet/provider/network_device' 3 | 4 | # This is the base class of all prefetched cisco device providers 5 | class Puppet::Provider::Cisco < Puppet::Provider::NetworkDevice 6 | def self.device(url) 7 | Puppet::Util::NetworkDevice::Cisco::Device.new(url) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/provider/confine/exists.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/confine' 2 | 3 | class Puppet::Provider::Confine::Exists < Puppet::Provider::Confine 4 | def self.summarize(confines) 5 | confines.inject([]) { |total, confine| total + confine.summary } 6 | end 7 | 8 | def pass?(value) 9 | value && (for_binary? ? which(value) : FileTest.exist?(value)) 10 | end 11 | 12 | def message(value) 13 | "file #{value} does not exist" 14 | end 15 | 16 | def summary 17 | result.zip(values).inject([]) { |array, args| val, f = args; array << f unless val; array } 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/puppet/provider/confine/false.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/confine' 2 | 3 | class Puppet::Provider::Confine::False < Puppet::Provider::Confine 4 | def self.summarize(confines) 5 | confines.inject(0) { |count, confine| count + confine.summary } 6 | end 7 | 8 | def pass?(value) 9 | ! value 10 | end 11 | 12 | def message(value) 13 | "true value when expecting false" 14 | end 15 | 16 | def summary 17 | result.find_all { |v| v == false }.length 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/puppet/provider/confine/feature.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/confine' 2 | 3 | class Puppet::Provider::Confine::Feature < Puppet::Provider::Confine 4 | def self.summarize(confines) 5 | confines.collect { |c| c.values }.flatten.uniq.find_all { |value| ! confines[0].pass?(value) } 6 | end 7 | 8 | # Is the named feature available? 9 | def pass?(value) 10 | Puppet.features.send(value.to_s + "?") 11 | end 12 | 13 | def message(value) 14 | "feature #{value} is missing" 15 | end 16 | end 17 | 18 | -------------------------------------------------------------------------------- /lib/puppet/provider/confine/true.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/confine' 2 | 3 | class Puppet::Provider::Confine::True < Puppet::Provider::Confine 4 | def self.summarize(confines) 5 | confines.inject(0) { |count, confine| count + confine.summary } 6 | end 7 | 8 | def pass?(value) 9 | # Double negate, so we only get true or false. 10 | ! ! value 11 | end 12 | 13 | def message(value) 14 | "false value when expecting true" 15 | end 16 | 17 | def summary 18 | result.find_all { |v| v == true }.length 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/puppet/provider/confiner.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/confine_collection' 2 | 3 | module Puppet::Provider::Confiner 4 | def confine(hash) 5 | confine_collection.confine(hash) 6 | end 7 | 8 | def confine_collection 9 | @confine_collection ||= Puppet::Provider::ConfineCollection.new(self.to_s) 10 | end 11 | 12 | # Check whether this implementation is suitable for our platform. 13 | def suitable?(short = true) 14 | return(short ? confine_collection.valid? : confine_collection.summary) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/puppet/provider/group/directoryservice.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/nameservice/directoryservice' 2 | 3 | Puppet::Type.type(:group).provide :directoryservice, :parent => Puppet::Provider::NameService::DirectoryService do 4 | desc "Group management using DirectoryService on OS X. 5 | 6 | " 7 | 8 | commands :dscl => "/usr/bin/dscl" 9 | confine :operatingsystem => :darwin 10 | defaultfor :operatingsystem => :darwin 11 | has_feature :manages_members 12 | end 13 | -------------------------------------------------------------------------------- /lib/puppet/provider/interface/base.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/lib/puppet/provider/interface/base.rb -------------------------------------------------------------------------------- /lib/puppet/provider/nameservice/pw.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/nameservice/objectadd' 2 | 3 | class Puppet::Provider::NameService 4 | class PW < ObjectAdd 5 | def deletecmd 6 | [command(:pw), "#{@resource.class.name.to_s}del", @resource[:name]] 7 | end 8 | 9 | def modifycmd(param, value) 10 | cmd = [ 11 | command(:pw), 12 | "#{@resource.class.name.to_s}mod", 13 | @resource[:name], 14 | flag(param), 15 | value 16 | ] 17 | cmd 18 | end 19 | end 20 | end 21 | 22 | -------------------------------------------------------------------------------- /lib/puppet/provider/package/sunfreeware.rb: -------------------------------------------------------------------------------- 1 | # At this point, it's an exact copy of the Blastwave stuff. 2 | Puppet::Type.type(:package).provide :sunfreeware, :parent => :blastwave, :source => :sun do 3 | desc "Package management using sunfreeware.com's `pkg-get` command on Solaris. 4 | At this point, support is exactly the same as `blastwave` support and 5 | has not actually been tested." 6 | commands :pkgget => "pkg-get" 7 | 8 | confine :operatingsystem => :solaris 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/rails/database/001_add_created_at_to_all_tables.rb: -------------------------------------------------------------------------------- 1 | class AddCreatedAtToAllTables < ActiveRecord::Migration 2 | def self.up 3 | ActiveRecord::Base.connection.tables.each do |t| 4 | add_column t.to_s, :created_at, :datetime unless ActiveRecord::Base.connection.columns(t).collect {|c| c.name}.include?("created_at") 5 | end 6 | end 7 | 8 | def self.down 9 | ActiveRecord::Base.connection.tables.each do |t| 10 | remove_column t.to_s, :created_at unless ActiveRecord::Base.connection.columns(t).collect {|c| c.name}.include?("created_at") 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb: -------------------------------------------------------------------------------- 1 | class RemoveDuplicatedIndexOnAllTables < ActiveRecord::Migration 2 | def self.up 3 | ActiveRecord::Base.connection.tables.each do |t| 4 | remove_index t.to_s, :id if ActiveRecord::Base.connection.indexes(t).collect {|c| c.columns}.include?("id") 5 | end 6 | end 7 | 8 | def self.down 9 | ActiveRecord::Base.connection.tables.each do |t| 10 | add_index t.to_s, :id, :integer => true unless ActiveRecord::Base.connection.indexes(t).collect {|c| c.columns}.include?("id") 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/puppet/rails/database/003_add_environment_to_host.rb: -------------------------------------------------------------------------------- 1 | class AddEnvironmentToHost < ActiveRecord::Migration 2 | def self.up 3 | add_column :hosts, :environment, :string unless ActiveRecord::Base.connection.columns(:hosts).collect {|c| c.name}.include?("environment") 4 | end 5 | 6 | def self.down 7 | remove_column :hosts, :environment if ActiveRecord::Base.connection.columns(:hosts).collect {|c| c.name}.include?("environment") 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/rails/fact_name.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/rails' 2 | require 'puppet/rails/fact_value' 3 | 4 | class Puppet::Rails::FactName < ActiveRecord::Base 5 | has_many :fact_values, :dependent => :destroy 6 | end 7 | -------------------------------------------------------------------------------- /lib/puppet/rails/fact_value.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Rails::FactValue < ActiveRecord::Base 2 | belongs_to :fact_name 3 | belongs_to :host 4 | 5 | def to_label 6 | "#{self.fact_name.name}" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/rails/inventory_fact.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/rails/inventory_node' 2 | 3 | class Puppet::Rails::InventoryFact < ::ActiveRecord::Base 4 | belongs_to :node, :class_name => "Puppet::Rails::InventoryNode" 5 | end 6 | -------------------------------------------------------------------------------- /lib/puppet/rails/puppet_tag.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/rails/resource_tag' 2 | require 'puppet/util/rails/cache_accumulator' 3 | 4 | class Puppet::Rails::PuppetTag < ActiveRecord::Base 5 | has_many :resource_tags, :dependent => :destroy 6 | has_many :resources, :through => :resource_tags 7 | 8 | include Puppet::Util::CacheAccumulator 9 | accumulates :name 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/rails/source_file.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Rails::SourceFile < ActiveRecord::Base 2 | has_one :host 3 | has_one :resource 4 | 5 | def to_label 6 | "#{self.filename}" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/reports/log.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/reports' 2 | 3 | Puppet::Reports.register_report(:log) do 4 | desc "Send all received logs to the local log destinations. Usually 5 | the log destination is syslog." 6 | 7 | def process 8 | self.logs.each do |log| 9 | log.source = "//#{self.host}/#{log.source}" 10 | Puppet::Util::Log.newmessage(log) 11 | end 12 | end 13 | end 14 | 15 | -------------------------------------------------------------------------------- /lib/puppet/resource/type_collection_helper.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/resource/type_collection' 2 | 3 | module Puppet::Resource::TypeCollectionHelper 4 | def known_resource_types 5 | environment.known_resource_types 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/puppet/ssl.rb: -------------------------------------------------------------------------------- 1 | # Just to make the constants work out. 2 | require 'puppet' 3 | require 'openssl' 4 | 5 | module Puppet::SSL # :nodoc: 6 | CA_NAME = "ca" 7 | require 'puppet/ssl/host' 8 | end 9 | -------------------------------------------------------------------------------- /lib/puppet/status.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/indirector' 2 | 3 | class Puppet::Status 4 | extend Puppet::Indirector 5 | indirects :status, :terminus_class => :local 6 | 7 | attr :status, true 8 | 9 | def initialize( status = nil ) 10 | @status = status || {"is_alive" => true} 11 | end 12 | 13 | def to_pson(*args) 14 | @status.to_pson 15 | end 16 | 17 | def self.from_pson( pson ) 18 | self.new( pson ) 19 | end 20 | 21 | def name 22 | "status" 23 | end 24 | 25 | def name=(name) 26 | # NOOP 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/puppet/type/file/ctime.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Puppet::Type.type(:file).newproperty(:ctime) do 3 | desc "A read-only state to check the file ctime." 4 | 5 | def retrieve 6 | current_value = :absent 7 | if stat = @resource.stat 8 | current_value = stat.ctime 9 | end 10 | current_value 11 | end 12 | 13 | validate do 14 | fail "ctime is read-only" 15 | end 16 | end 17 | end 18 | 19 | -------------------------------------------------------------------------------- /lib/puppet/type/file/mtime.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Puppet::Type.type(:file).newproperty(:mtime) do 3 | desc "A read-only state to check the file mtime." 4 | 5 | def retrieve 6 | current_value = :absent 7 | if stat = @resource.stat 8 | current_value = stat.mtime 9 | end 10 | current_value 11 | end 12 | 13 | validate do 14 | fail "mtime is read-only" 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/puppet/type/file/type.rb: -------------------------------------------------------------------------------- 1 | module Puppet 2 | Puppet::Type.type(:file).newproperty(:type) do 3 | require 'etc' 4 | desc "A read-only state to check the file type." 5 | 6 | def retrieve 7 | current_value = :absent 8 | if stat = @resource.stat 9 | current_value = stat.ftype 10 | end 11 | current_value 12 | end 13 | 14 | validate do 15 | fail "type is read-only" 16 | end 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_command.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :command 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_contact.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :contact 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_contactgroup.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :contactgroup 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_host.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :host 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_hostdependency.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :hostdependency 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_hostescalation.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :hostescalation 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_hostextinfo.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :hostextinfo 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_hostgroup.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :hostgroup 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_service.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :service 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_servicedependency.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :servicedependency 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_serviceescalation.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :serviceescalation 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_serviceextinfo.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :serviceextinfo 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_servicegroup.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :servicegroup 4 | -------------------------------------------------------------------------------- /lib/puppet/type/nagios_timeperiod.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/util/nagios_maker' 2 | 3 | Puppet::Util::NagiosMaker.create_nagios_type :timeperiod 4 | -------------------------------------------------------------------------------- /lib/puppet/type/router.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Manage a router abstraction 3 | # 4 | 5 | module Puppet 6 | newtype(:router) do 7 | @doc = "Manages connected router." 8 | 9 | newparam(:url) do 10 | desc "An URL to access the router of the form (ssh|telnet)://user:pass:enable@host/." 11 | isnamevar 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/puppet/type/vlan.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Manages a Vlan on a given router or switch 3 | # 4 | 5 | Puppet::Type.newtype(:vlan) do 6 | @doc = "This represents a router or switch vlan." 7 | 8 | apply_to_device 9 | 10 | ensurable 11 | 12 | newparam(:name) do 13 | desc "Vlan id. It must be a number" 14 | isnamevar 15 | 16 | newvalues(/^\d+/) 17 | end 18 | 19 | newproperty(:description) do 20 | desc "Vlan name" 21 | end 22 | 23 | newparam(:device_url) do 24 | desc "Url to connect to a router or switch." 25 | end 26 | end -------------------------------------------------------------------------------- /lib/puppet/type/whit.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.newtype(:whit) do 2 | desc "The smallest possible resource type, for when you need a resource and naught else." 3 | 4 | newparam :name do 5 | desc "The name of the whit, because it must have one." 6 | end 7 | 8 | 9 | # Hide the fact that we're a whit from logs 10 | def to_s 11 | name.sub(/^completed_|^admissible_/, "") 12 | end 13 | 14 | def path 15 | to_s 16 | end 17 | 18 | def refresh 19 | # We don't do anything with them, but we need this to 20 | # show that we are "refresh aware" and not break the 21 | # chain of propogation. 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/puppet/util/constant_inflector.rb: -------------------------------------------------------------------------------- 1 | # Created on 2008-02-12 2 | # Copyright Luke Kanies 3 | 4 | # A common module for converting between constants and 5 | # file names. 6 | module Puppet::Util::ConstantInflector 7 | def file2constant(file) 8 | # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] 9 | x = file.split("/").collect { |name| name.capitalize }.join("::").gsub(/_+(.)/) { |term| $1.capitalize } 10 | end 11 | 12 | def constant2file(constant) 13 | constant.to_s.gsub(/([a-z])([A-Z])/) { |term| $1 + "_#{$2}" }.gsub("::", "/").downcase 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/puppet/util/execution.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Util::Execution 2 | module_function 3 | 4 | # Run some code with a specific environment. Resets the environment back to 5 | # what it was at the end of the code. 6 | def withenv(hash) 7 | saved = ENV.to_hash 8 | hash.each do |name, val| 9 | ENV[name.to_s] = val 10 | end 11 | 12 | yield 13 | ensure 14 | ENV.clear 15 | saved.each do |name, val| 16 | ENV[name] = val 17 | end 18 | end 19 | end 20 | 21 | -------------------------------------------------------------------------------- /lib/puppet/util/inline_docs.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Util::InlineDocs 2 | def self.included(klass) 3 | klass.send(:include, InstanceMethods) 4 | klass.extend ClassMethods 5 | end 6 | 7 | module ClassMethods 8 | attr_accessor :use_docs 9 | def associates_doc 10 | self.use_docs = true 11 | end 12 | end 13 | 14 | module InstanceMethods 15 | attr_writer :doc 16 | 17 | def doc 18 | @doc ||= "" 19 | end 20 | 21 | # don't fetch lexer comment by default 22 | def use_docs 23 | self.class.use_docs 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/puppet/util/ldap.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Util::Ldap 2 | end 3 | -------------------------------------------------------------------------------- /lib/puppet/util/log_paths.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Util::LogPaths 2 | # return the full path to us, for logging and rollback 3 | # some classes (e.g., FileTypeRecords) will have to override this 4 | def path 5 | @path ||= pathbuilder 6 | 7 | "/" + @path.join("/") 8 | end 9 | 10 | def source_descriptors 11 | descriptors = {} 12 | 13 | descriptors[:tags] = tags 14 | 15 | [:path, :file, :line].each do |param| 16 | next unless value = send(param) 17 | descriptors[param] = value 18 | end 19 | 20 | descriptors 21 | end 22 | 23 | end 24 | 25 | -------------------------------------------------------------------------------- /lib/puppet/util/metaid.rb: -------------------------------------------------------------------------------- 1 | class Object 2 | # The hidden singleton lurks behind everyone 3 | def singleton_class; class << self; self; end; end 4 | def meta_eval(&blk); singleton_class.instance_eval(&blk); end 5 | 6 | # Adds methods to a singleton_class 7 | def meta_def(name, &blk) 8 | meta_eval { define_method name, &blk } 9 | end 10 | 11 | # Remove singleton_class methods. 12 | def meta_undef(name, &blk) 13 | meta_eval { remove_method name } 14 | end 15 | 16 | # Defines an instance method within a class 17 | def class_def(name, &blk) 18 | class_eval { define_method name, &blk } 19 | end 20 | end 21 | 22 | -------------------------------------------------------------------------------- /lib/puppet/util/network_device.rb: -------------------------------------------------------------------------------- 1 | class Puppet::Util::NetworkDevice 2 | class << self 3 | attr_reader :current 4 | end 5 | 6 | def self.init(device) 7 | require "puppet/util/network_device/#{device.provider}/device" 8 | @current = Puppet::Util::NetworkDevice.const_get(device.provider.capitalize).const_get(:Device).new(device.url) 9 | rescue => detail 10 | raise "Can't load #{device.provider} for #{device.name}: #{detail}" 11 | end 12 | 13 | # Should only be used in tests 14 | def self.teardown 15 | @current = nil 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/puppet/util/network_device/cisco.rb: -------------------------------------------------------------------------------- 1 | 2 | module Puppet::Util::NetworkDevice::Cisco 3 | 4 | end -------------------------------------------------------------------------------- /lib/puppet/util/network_device/transport.rb: -------------------------------------------------------------------------------- 1 | # stub 2 | module Puppet::Util::NetworkDevice::Transport 3 | end -------------------------------------------------------------------------------- /lib/puppet/util/network_device/transport/base.rb: -------------------------------------------------------------------------------- 1 | 2 | require 'puppet/util/network_device' 3 | require 'puppet/util/network_device/transport' 4 | 5 | class Puppet::Util::NetworkDevice::Transport::Base 6 | attr_accessor :user, :password, :host, :port 7 | attr_accessor :default_prompt, :timeout 8 | 9 | def initialize 10 | @timeout = 10 11 | end 12 | 13 | def send(cmd) 14 | end 15 | 16 | def expect(prompt) 17 | end 18 | 19 | def command(cmd, options = {}) 20 | send(cmd) 21 | expect(options[:prompt] || default_prompt) do |output| 22 | yield output if block_given? 23 | end 24 | end 25 | 26 | end -------------------------------------------------------------------------------- /lib/puppet/util/rails/collection_merger.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Util::CollectionMerger 2 | def ar_hash_merge(db_hash, mem_hash, args) 3 | (db_hash.keys | mem_hash.keys).each do |key| 4 | if (db_hash[key] && mem_hash[key]) 5 | # in both, update value 6 | args[:modify].call(db_hash[key], mem_hash[key]) 7 | elsif (db_hash[key]) 8 | # in db, not memory, delete from database 9 | args[:delete].call(db_hash[key]) 10 | else 11 | # in mem, not in db, insert into the database 12 | args[:create].call(key, mem_hash[key]) 13 | end 14 | end 15 | end 16 | end 17 | 18 | -------------------------------------------------------------------------------- /lib/puppet/util/user_attr.rb: -------------------------------------------------------------------------------- 1 | class UserAttr 2 | def self.get_attributes_by_name(name) 3 | attributes = nil 4 | 5 | File.readlines('/etc/user_attr').each do |line| 6 | next if line =~ /^#/ 7 | 8 | token = line.split(':') 9 | 10 | if token[0] == name 11 | attributes = {:name => name} 12 | token[4].split(';').each do |attr| 13 | key_value = attr.split('=') 14 | attributes[key_value[0].intern] = key_value[1].strip 15 | end 16 | break 17 | end 18 | end 19 | attributes 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /man/man8/puppet.8: -------------------------------------------------------------------------------- 1 | .\" generated with Ronn/v0.7.3 2 | .\" http://github.com/rtomayko/ronn/tree/0.7.3 3 | . 4 | .TH "PUPPET" "8" "June 2011" "Puppet Labs, LLC" "Puppet manual" 5 | . 6 | .SH "NAME" 7 | \fBpuppet\fR 8 | . 9 | .P 10 | See \'puppet help\' for help on available puppet subcommands 11 | -------------------------------------------------------------------------------- /sbin/puppetca: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/cert' 4 | Puppet::Application[:cert].run 5 | -------------------------------------------------------------------------------- /sbin/puppetd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/agent' 4 | Puppet::Application[:agent].run 5 | -------------------------------------------------------------------------------- /sbin/puppetmasterd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/master' 4 | Puppet::Application[:master].run 5 | -------------------------------------------------------------------------------- /sbin/puppetqd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/queue' 4 | Puppet::Application[:queue].run 5 | -------------------------------------------------------------------------------- /sbin/puppetrun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'puppet/application/kick' 4 | Puppet::Application[:kick].run 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/faulty_face/puppet/face/syntax.rb: -------------------------------------------------------------------------------- 1 | Puppet::Face.define(:syntax, '1.0.0') do 2 | action :foo do 3 | when_invoked do |whom| 4 | "hello, #{whom}" 5 | end 6 | # This 'end' is deliberately omitted, to induce a syntax error. 7 | # Please don't fix that, as it is used for testing. --daniel 2011-05-02 8 | end 9 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/aliastest.pp: -------------------------------------------------------------------------------- 1 | file { "a file": 2 | path => "/tmp/aliastest", 3 | ensure => file 4 | } 5 | 6 | file { "another": 7 | path => "/tmp/aliastest2", 8 | ensure => file, 9 | require => File["a file"] 10 | } 11 | 12 | file { "a third": 13 | path => "/tmp/aliastest3", 14 | ensure => file, 15 | require => File["/tmp/aliastest"] 16 | } 17 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/append.pp: -------------------------------------------------------------------------------- 1 | $var=['/tmp/file1','/tmp/file2'] 2 | 3 | class arraytest { 4 | $var += ['/tmp/file3', '/tmp/file4'] 5 | file { 6 | $var: 7 | content => "test" 8 | } 9 | } 10 | 11 | include arraytest 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/argumentdefaults.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define testargs($file, $mode = 755) { 4 | file { $file: ensure => file, mode => $mode } 5 | } 6 | 7 | testargs { "testingname": 8 | file => "/tmp/argumenttest1" 9 | } 10 | 11 | testargs { "testingother": 12 | file => "/tmp/argumenttest2", 13 | mode => 644 14 | } 15 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/arithmetic_expression.pp: -------------------------------------------------------------------------------- 1 | 2 | $one = 1.30 3 | $two = 2.034e-2 4 | 5 | $result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9) 6 | 7 | 8 | notice("result is $result == 1295.87692307692") -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp: -------------------------------------------------------------------------------- 1 | file { 2 | ["/tmp/arraytrailingcomma1","/tmp/arraytrailingcomma2", ]: content => "tmp" 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/classheirarchy.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | class base { 4 | file { "/tmp/classheir1": ensure => file, mode => 755 } 5 | } 6 | 7 | class sub1 inherits base { 8 | file { "/tmp/classheir2": ensure => file, mode => 755 } 9 | } 10 | 11 | class sub2 inherits base { 12 | file { "/tmp/classheir3": ensure => file, mode => 755 } 13 | } 14 | 15 | include sub1, sub2 16 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/classincludes.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | class base { 4 | file { "/tmp/classincludes1": ensure => file, mode => 755 } 5 | } 6 | 7 | class sub1 inherits base { 8 | file { "/tmp/classincludes2": ensure => file, mode => 755 } 9 | } 10 | 11 | class sub2 inherits base { 12 | file { "/tmp/classincludes3": ensure => file, mode => 755 } 13 | } 14 | 15 | $sub = "sub2" 16 | 17 | include sub1, $sub 18 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/classpathtest.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define mytype { 4 | file { "/tmp/classtest": ensure => file, mode => 755 } 5 | } 6 | 7 | class testing { 8 | mytype { "componentname": } 9 | } 10 | 11 | include testing 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/collection.pp: -------------------------------------------------------------------------------- 1 | class one { 2 | @file { "/tmp/colltest1": content => "one" } 3 | @file { "/tmp/colltest2": content => "two" } 4 | } 5 | 6 | class two { 7 | File <| content == "one" |> 8 | } 9 | 10 | include one, two 11 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/collection_override.pp: -------------------------------------------------------------------------------- 1 | @file { 2 | "/tmp/collection": 3 | content => "whatever" 4 | } 5 | 6 | File<| |> { 7 | mode => 0600 8 | } 9 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp: -------------------------------------------------------------------------------- 1 | define test($name) { 2 | file {"/tmp/collection_within_virtual_definitions1_$name.txt": 3 | content => "File name $name\n" 4 | } 5 | Test2 <||> 6 | } 7 | 8 | define test2() { 9 | file {"/tmp/collection_within_virtual_definitions2_$name.txt": 10 | content => "This is a test\n" 11 | } 12 | } 13 | 14 | node default { 15 | @test {"foo": 16 | name => "foo" 17 | } 18 | @test2 {"foo2": } 19 | Test <||> 20 | } 21 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/componentmetaparams.pp: -------------------------------------------------------------------------------- 1 | file { "/tmp/component1": 2 | ensure => file 3 | } 4 | 5 | define thing { 6 | file { $name: ensure => file } 7 | } 8 | 9 | thing { "/tmp/component2": 10 | require => File["/tmp/component1"] 11 | } 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/componentrequire.pp: -------------------------------------------------------------------------------- 1 | define testfile($mode) { 2 | file { $name: mode => $mode, ensure => present } 3 | } 4 | 5 | testfile { "/tmp/testing_component_requires2": mode => 755 } 6 | 7 | file { "/tmp/testing_component_requires1": mode => 755, ensure => present, 8 | require => Testfile["/tmp/testing_component_requires2"] } 9 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | class base { 4 | file { "/tmp/deepclassheir1": ensure => file, mode => 755 } 5 | } 6 | 7 | class sub1 inherits base { 8 | file { "/tmp/deepclassheir2": ensure => file, mode => 755 } 9 | } 10 | 11 | class sub2 inherits sub1 { 12 | file { "/tmp/deepclassheir3": ensure => file, mode => 755 } 13 | } 14 | 15 | class sub3 inherits sub2 { 16 | file { "/tmp/deepclassheir4": ensure => file, mode => 755 } 17 | } 18 | 19 | class sub4 inherits sub3 { 20 | file { "/tmp/deepclassheir5": ensure => file, mode => 755 } 21 | } 22 | 23 | include sub4 24 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/defineoverrides.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $file = "/tmp/defineoverrides1" 4 | 5 | define myfile($mode) { 6 | file { $name: ensure => file, mode => $mode } 7 | } 8 | 9 | class base { 10 | myfile { $file: mode => 644 } 11 | } 12 | 13 | class sub inherits base { 14 | Myfile[$file] { mode => 755, } # test the end-comma 15 | } 16 | 17 | include sub 18 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/emptyclass.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define component { 4 | } 5 | 6 | class testing { 7 | } 8 | 9 | include testing 10 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/emptyexec.pp: -------------------------------------------------------------------------------- 1 | exec { "touch /tmp/emptyexectest": 2 | path => "/usr/bin:/bin" 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/emptyifelse.pp: -------------------------------------------------------------------------------- 1 | 2 | if false { 3 | } else { 4 | # nothing here 5 | } 6 | 7 | if true { 8 | # still nothing 9 | } 10 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/falsevalues.pp: -------------------------------------------------------------------------------- 1 | $value = false 2 | 3 | file { "/tmp/falsevalues$value": ensure => file } 4 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/filecreate.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { 4 | "/tmp/createatest": ensure => file, mode => 755; 5 | "/tmp/createbtest": ensure => file, mode => 755 6 | } 7 | 8 | file { 9 | "/tmp/createctest": ensure => file; 10 | "/tmp/createdtest": ensure => file; 11 | } 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/fqdefinition.pp: -------------------------------------------------------------------------------- 1 | define one::two($ensure) { 2 | file { "/tmp/fqdefinition": ensure => $ensure } 3 | } 4 | 5 | one::two { "/tmp/fqdefinition": ensure => file } 6 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/fqparents.pp: -------------------------------------------------------------------------------- 1 | class base { 2 | class one { 3 | file { "/tmp/fqparent1": ensure => file } 4 | } 5 | } 6 | 7 | class two::three inherits base::one { 8 | file { "/tmp/fqparent2": ensure => file } 9 | } 10 | 11 | include two::three 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/funccomma.pp: -------------------------------------------------------------------------------- 1 | @file { 2 | ["/tmp/funccomma1","/tmp/funccomma2"]: content => "1" 3 | } 4 | 5 | realize( File["/tmp/funccomma1"], File["/tmp/funccomma2"] , ) 6 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/ifexpression.pp: -------------------------------------------------------------------------------- 1 | $one = 1 2 | $two = 2 3 | 4 | if ($one < $two) and (($two < 3) or ($two == 2)) { 5 | notice("True!") 6 | } 7 | 8 | if "test regex" =~ /(.*) regex/ { 9 | file { 10 | "/tmp/${1}iftest": ensure => file, mode => 0755 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/implicititeration.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $files = ["/tmp/iterationatest", "/tmp/iterationbtest"] 4 | 5 | file { $files: ensure => file, mode => 755 } 6 | 7 | file { ["/tmp/iterationctest", "/tmp/iterationdtest"]: 8 | ensure => file, 9 | mode => 755 10 | } 11 | 12 | file { 13 | ["/tmp/iterationetest", "/tmp/iterationftest"]: ensure => file, mode => 755; 14 | ["/tmp/iterationgtest", "/tmp/iterationhtest"]: ensure => file, mode => 755; 15 | } 16 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/multilinecomments.pp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | file { 4 | "/tmp/multilinecomments": content => "pouet" 5 | } 6 | */ 7 | 8 | /* and another one for #2333, the whitespace after the 9 | end comment is here on purpose */ 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/multipleclass.pp: -------------------------------------------------------------------------------- 1 | class one { 2 | file { "/tmp/multipleclassone": content => "one" } 3 | } 4 | 5 | class one { 6 | file { "/tmp/multipleclasstwo": content => "two" } 7 | } 8 | 9 | include one 10 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/multipleinstances.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { 4 | "/tmp/multipleinstancesa": ensure => file, mode => 755; 5 | "/tmp/multipleinstancesb": ensure => file, mode => 755; 6 | "/tmp/multipleinstancesc": ensure => file, mode => 755; 7 | } 8 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/multisubs.pp: -------------------------------------------------------------------------------- 1 | class base { 2 | file { "/tmp/multisubtest": content => "base", mode => 644 } 3 | } 4 | 5 | class sub1 inherits base { 6 | File["/tmp/multisubtest"] { mode => 755 } 7 | } 8 | 9 | class sub2 inherits base { 10 | File["/tmp/multisubtest"] { content => sub2 } 11 | } 12 | 13 | include sub1, sub2 14 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/namevartest.pp: -------------------------------------------------------------------------------- 1 | define filetest($mode, $ensure = file) { 2 | file { $name: 3 | mode => $mode, 4 | ensure => $ensure 5 | } 6 | } 7 | 8 | filetest { "/tmp/testfiletest": mode => 644} 9 | filetest { "/tmp/testdirtest": mode => 755, ensure => directory} 10 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/scopetest.pp: -------------------------------------------------------------------------------- 1 | 2 | $mode = 640 3 | 4 | define thing { 5 | file { "/tmp/$name": ensure => file, mode => $mode } 6 | } 7 | 8 | class testing { 9 | $mode = 755 10 | thing {scopetest: } 11 | } 12 | 13 | include testing 14 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/simpledefaults.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | File { mode => 755 } 4 | 5 | file { "/tmp/defaulttest": ensure => file } 6 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/singleary.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { "/tmp/singleary1": 4 | ensure => file 5 | } 6 | 7 | file { "/tmp/singleary2": 8 | ensure => file 9 | } 10 | 11 | file { "/tmp/singleary3": 12 | ensure => file, 13 | require => [File["/tmp/singleary1"], File["/tmp/singleary2"]] 14 | } 15 | 16 | file { "/tmp/singleary4": 17 | ensure => file, 18 | require => [File["/tmp/singleary1"]] 19 | } 20 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/singlequote.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { "/tmp/singlequote1": 4 | ensure => file, 5 | content => 'a $quote' 6 | } 7 | 8 | file { "/tmp/singlequote2": 9 | ensure => file, 10 | content => 'some "\yayness\"' 11 | } 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/singleselector.pp: -------------------------------------------------------------------------------- 1 | $value1 = "" 2 | $value2 = true 3 | $value3 = false 4 | $value4 = yay 5 | 6 | $test = "yay" 7 | 8 | $mode1 = $value1 ? { 9 | "" => 755 10 | } 11 | 12 | $mode2 = $value2 ? { 13 | true => 755 14 | } 15 | 16 | $mode3 = $value3 ? { 17 | default => 755 18 | } 19 | 20 | file { "/tmp/singleselector1": ensure => file, mode => $mode1 } 21 | file { "/tmp/singleselector2": ensure => file, mode => $mode2 } 22 | file { "/tmp/singleselector3": ensure => file, mode => $mode3 } 23 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env puppet 2 | 3 | class one::fake { 4 | file { "/tmp/subclass_name_duplication1": ensure => present } 5 | } 6 | 7 | class two::fake { 8 | file { "/tmp/subclass_name_duplication2": ensure => present } 9 | } 10 | 11 | include one::fake, two::fake 12 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/tag.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $variable = value 4 | 5 | tag yayness, rahness 6 | 7 | tag booness, $variable 8 | 9 | file { "/tmp/settestingness": ensure => file } 10 | -------------------------------------------------------------------------------- /spec/fixtures/unit/parser/lexer/virtualresources.pp: -------------------------------------------------------------------------------- 1 | class one { 2 | @file { "/tmp/virtualtest1": content => "one" } 3 | @file { "/tmp/virtualtest2": content => "two" } 4 | @file { "/tmp/virtualtest3": content => "three" } 5 | @file { "/tmp/virtualtest4": content => "four" } 6 | } 7 | 8 | class two { 9 | File <| content == "one" |> 10 | realize File["/tmp/virtualtest2"] 11 | realize(File["/tmp/virtualtest3"], File["/tmp/virtualtest4"]) 12 | } 13 | 14 | include one, two 15 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/host/parsed/valid_hosts: -------------------------------------------------------------------------------- 1 | # Some leading comment, that should be ignored 2 | # The next line is empty so it should be ignored 3 | 4 | ::1 localhost 5 | 6 | # We now try another delimiter: Several tabs 7 | 127.0.0.1 localhost 8 | 9 | # No test trailing spaces 10 | 10.0.0.1 host1 11 | 12 | # Ok its time to test aliases 13 | 2001:252:0:1::2008:8 ipv6host alias1 14 | 192.168.0.1 ipv4host alias2 alias3 15 | 16 | # Testing inlinecomments now 17 | 192.168.0.2 host3 # This is host3 18 | 192.168.0.3 host4 alias10 # This is host4 19 | 192.168.0.4 host5 alias11 alias12 # This is host5 20 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/mount-output.aix.txt: -------------------------------------------------------------------------------- 1 | node mounted mounted over vfs date options 2 | ---- ------- ------------ --- ------------ ------------------- 3 | /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8 4 | /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8 5 | /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8 6 | /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8 7 | sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8 8 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/aix.mount: -------------------------------------------------------------------------------- 1 | node mounted mounted over vfs date options 2 | ---- ------- ------------ --- ------------ ------------------- 3 | /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8 4 | /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8 5 | /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8 6 | /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8 7 | sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8 8 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/darwin.mount: -------------------------------------------------------------------------------- 1 | /dev/disk0s2 on / (hfs, local, journaled) 2 | devfs on /dev (devfs, local, nobrowse) 3 | map -hosts on /net (autofs, nosuid, automounted, nobrowse) 4 | map auto_home on /home (autofs, automounted, nobrowse) 5 | /dev/disk0s3 on /usr (hfs, local, journaled) 6 | /dev/fake on /ghost (hfs, local, journaled) 7 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/freebsd.fstab: -------------------------------------------------------------------------------- 1 | # Device Mountpoint FStype Options Dump Pass# 2 | /dev/ad0s1b none swap sw 0 0 3 | /dev/ad0s1a / ufs rw 1 1 4 | /dev/ad0s1e /tmp ufs rw 2 2 5 | /dev/ad0s1f /usr ufs rw 2 2 6 | /dev/ad0s1d /var ufs rw 2 2 7 | /dev/ad0s1g /boot ufs rw 2 2 8 | /dev/acd0 /cdrom cd9660 ro,noauto 0 0 9 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/freebsd.mount: -------------------------------------------------------------------------------- 1 | /dev/ad0s1a on / (ufs, local, soft-updates) 2 | /dev/ad0s1d on /ghost (ufs, local, soft-updates) 3 | devfs on /dev (devfs, local, multilabel) 4 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/linux.mount: -------------------------------------------------------------------------------- 1 | /dev/root on / type jfs (rw,noatime) 2 | rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755) 3 | sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) 4 | /dev/sda9 on /usr/portage type jfs (rw) 5 | /dev/fake on /ghost type jfs (rw) 6 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/netbsd.mount: -------------------------------------------------------------------------------- 1 | /dev/ad0s1a on / (ufs, local) 2 | devfs on /dev (devfs, local) 3 | /dev/ad0s1e on /tmp (ufs, local, soft-updates) 4 | /dev/ad0s1f on /usr (ufs, local, soft-updates) 5 | /dev/ad0s1d on /var (ufs, local, soft-updates) 6 | /dev/ad3s1e on /data (ufs, local, soft-updates) 7 | /dev/ad3s1h on /ghost (ufs, local, soft-updates) 8 | devfs on /var/named/dev (devfs, local) 9 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/openbsd.fstab: -------------------------------------------------------------------------------- 1 | /dev/wd0a / ffs rw 1 1 2 | /dev/wd0e /home ffs rw,nodev,nosuid 1 2 3 | /dev/wd0d /usr ffs rw,nodev 1 2 4 | /dev/wd0f /boot ffs rw,nodev 1 2 5 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/openbsd.mount: -------------------------------------------------------------------------------- 1 | /dev/wd0a on / type ffs (local) 2 | /dev/wd0e on /home type ffs (local, nodev, nosuid) 3 | /dev/wd0d on /usr type ffs (local, nodev) 4 | /dev/wd0g on /ghost type ffs (local, nodev) 5 | -------------------------------------------------------------------------------- /spec/fixtures/unit/provider/mount/parsed/solaris.mount: -------------------------------------------------------------------------------- 1 | / on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200000 on Mon Mar 18 08:48:45 2002 2 | /proc on /proc read/write/setuid/dev=4300000 on Mon Mar 18 08:48:44 2002 3 | /etc/mnttab on mnttab read/write/setuid/dev=43c0000 on Mon Mar 18 08:48:44 2002 4 | /tmp on swap read/write/setuid/xattr/dev=2 on Mon Mar 18 08:48:52 2002 5 | /export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 6 | /ghost on /dev/dsk/c0t1d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 7 | -------------------------------------------------------------------------------- /spec/fixtures/unit/reports/tagmail/tagmail_failers.conf: -------------------------------------------------------------------------------- 1 | tag: 2 | : abuse@domain.com 3 | invalid!tag: abuse@domain.com 4 | -------------------------------------------------------------------------------- /spec/fixtures/unit/util/rdoc/basic.pp: -------------------------------------------------------------------------------- 1 | # im a class 2 | class foo { 3 | file { '/tmp/foo' : 4 | ensure => present, 5 | } 6 | } 7 | 8 | # im a node 9 | node gar { 10 | } 11 | 12 | # im a define 13 | define baz { } 14 | 15 | # im a resource 16 | host { 'cow' : } 17 | -------------------------------------------------------------------------------- /spec/fixtures/yaml/test.local.yaml: -------------------------------------------------------------------------------- 1 | --- !ruby/object:Puppet::Node::Facts 2 | expiration: 2010-06-07 19:15:36.519351 -07:00 3 | name: test.local 4 | values: 5 | sp_number_processors: "2" 6 | kernelmajversion: "10.3" 7 | kernelversion: 10.3.1 8 | sp_secure_vm: secure_vm_enabled 9 | ps: ps auxwww 10 | macosx_productversion_major: "10.6" 11 | hostname: test 12 | !ruby/sym _timestamp: Mon Jun 07 18:45:36 -0700 2010 13 | facterversion: 1.5.7 14 | sp_packages: "1" 15 | timezone: PDT 16 | environment: production 17 | -------------------------------------------------------------------------------- /spec/integration/file_serving/content_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/file_serving/content' 5 | require 'shared_behaviours/file_serving' 6 | 7 | describe Puppet::FileServing::Content, " when finding files" do 8 | it_should_behave_like "Puppet::FileServing::Files" 9 | 10 | before do 11 | @test_class = Puppet::FileServing::Content 12 | @indirection = Puppet::FileServing::Content.indirection 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/integration/file_serving/fileset_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/file_serving/fileset' 5 | 6 | describe Puppet::FileServing::Fileset do 7 | it "should be able to recurse on a single file" do 8 | @path = Tempfile.new("fileset_integration") 9 | 10 | fileset = Puppet::FileServing::Fileset.new(@path.path) 11 | lambda { fileset.files }.should_not raise_error 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/integration/file_serving/metadata_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/file_serving/metadata' 5 | require 'shared_behaviours/file_serving' 6 | require 'puppet/indirector/file_metadata/file_server' 7 | 8 | describe Puppet::FileServing::Metadata, " when finding files" do 9 | it_should_behave_like "Puppet::FileServing::Files" 10 | 11 | before do 12 | @test_class = Puppet::FileServing::Metadata 13 | @indirection = Puppet::FileServing::Metadata.indirection 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/integration/indirector/file_metadata/file_server_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_metadata/file_server' 5 | require 'shared_behaviours/file_server_terminus' 6 | 7 | describe Puppet::Indirector::FileMetadata::FileServer, " when finding files", :fails_on_windows => true do 8 | it_should_behave_like "Puppet::Indirector::FileServerTerminus" 9 | 10 | before do 11 | @terminus = Puppet::Indirector::FileMetadata::FileServer.new 12 | @test_class = Puppet::FileServing::Metadata 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/integration/indirector/node/ldap_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/node/ldap' 5 | 6 | describe Puppet::Node::Ldap do 7 | it "should use a restrictive filter when searching for nodes in a class" do 8 | ldap = Puppet::Node.indirection.terminus(:ldap) 9 | Puppet::Node.indirection.stubs(:terminus).returns ldap 10 | ldap.expects(:ldapsearch).with("(&(objectclass=puppetClient)(puppetclass=foo))") 11 | 12 | Puppet::Node.indirection.search "eh", :class => "foo" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/integration/network/client_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/network/client' 5 | 6 | describe Puppet::Network::Client do 7 | %w{ca file report runner status}.each do |name| 8 | it "should have a #{name} client" do 9 | Puppet::Network::Client.client(name).should be_instance_of(Class) 10 | end 11 | 12 | [:name, :handler, :drivername].each do |data| 13 | it "should have a #{data} value for the #{name} client" do 14 | Puppet::Network::Client.client(name).send(data).should_not be_nil 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/integration/parser/functions_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | describe Puppet::Parser::Functions do 5 | before :each do 6 | Puppet::Parser::Functions.rmfunction("template") if Puppet::Parser::Functions.functions.include?("template") 7 | end 8 | 9 | it "should support multiple threads autoloading the same function" do 10 | threads = [] 11 | lambda { 12 | 10.times { |a| 13 | threads << Thread.new { 14 | Puppet::Parser::Functions.function("template") 15 | } 16 | } 17 | }.should_not raise_error 18 | threads.each { |t| t.join } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /spec/integration/provider/mailalias/aliases_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'shared_behaviours/all_parsedfile_providers' 4 | 5 | provider_class = Puppet::Type.type(:mailalias).provider(:aliases) 6 | 7 | describe provider_class do 8 | # #1560, in which we corrupt the format of complex mail aliases. 9 | it_should_behave_like "all parsedfile providers", provider_class 10 | end 11 | -------------------------------------------------------------------------------- /spec/integration/reference/providers_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/util/reference' 5 | 6 | reference = Puppet::Util::Reference.reference(:providers) 7 | 8 | describe reference do 9 | it "should exist" do 10 | reference.should_not be_nil 11 | end 12 | 13 | it "should be able to be rendered as markdown" do 14 | lambda { reference.to_markdown }.should_not raise_error 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/integration/reports_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/reports' 5 | 6 | describe Puppet::Reports, " when using report types" do 7 | before do 8 | Puppet.settings.stubs(:use) 9 | end 10 | 11 | it "should load report types as modules" do 12 | Puppet::Reports.report(:store).should be_instance_of(Module) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/integration/util_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'spec_helper' 4 | 5 | describe Puppet::Util do 6 | describe "#execute" do 7 | it "should properly allow stdout and stderr to share a file" do 8 | command = "ruby -e '(1..10).each {|i| (i%2==0) ? $stdout.puts(i) : $stderr.puts(i)}'" 9 | 10 | Puppet::Util.execute(command, :combine => true).split.should =~ [*'1'..'10'] 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/lib/puppet/face/1.0.0/huzzah.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/face' 2 | Puppet::Face.define(:huzzah, '1.0.0') do 3 | copyright "Puppet Labs", 2011 4 | license "Apache 2 license; see COPYING" 5 | summary "life is a thing for celebration" 6 | script :obsolete_in_core do |_| "you are in obsolete core now!" end 7 | script :call_newer do |_| method_on_newer end 8 | end 9 | -------------------------------------------------------------------------------- /spec/lib/puppet/face/huzzah.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/face' 2 | Puppet::Face.define(:huzzah, '2.0.1') do 3 | copyright "Puppet Labs", 2011 4 | license "Apache 2 license; see COPYING" 5 | summary "life is a thing for celebration" 6 | script :bar do |options| "is where beer comes from" end 7 | script :call_older do |_| method_on_older end 8 | end 9 | -------------------------------------------------------------------------------- /spec/lib/puppet/face/huzzah/obsolete.rb: -------------------------------------------------------------------------------- 1 | Puppet::Face.define(:huzzah, '1.0.0') do 2 | action :obsolete do 3 | summary "This is an action on version 1.0.0 of the face" 4 | when_invoked do |options| options end 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/lib/puppet/face/version_matching.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/face' 2 | 3 | # The set of versions here are used explicitly in the interface_spec; if you 4 | # change this you need to ensure that is still correct. --daniel 2011-04-21 5 | ['1.0.0', '1.0.1', '1.1.0', '1.1.1', '2.0.0'].each do |version| 6 | Puppet::Face.define(:version_matching, version) do 7 | copyright "Puppet Labs", 2011 8 | license "Apache 2 license; see COPYING" 9 | summary "version matching face #{version}" 10 | script :version do |options| version end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/lib/puppet_spec/verbose.rb: -------------------------------------------------------------------------------- 1 | # Support code for running stuff with warnings disabled. 2 | module Kernel 3 | def with_verbose_disabled 4 | verbose, $VERBOSE = $VERBOSE, nil 5 | result = yield 6 | $VERBOSE = verbose 7 | return result 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/monkey_patches/alias_should_to_must.rb: -------------------------------------------------------------------------------- 1 | require 'rspec' 2 | 3 | class Object 4 | # This is necessary because the RAL has a 'should' 5 | # method. 6 | alias :must :should 7 | alias :must_not :should_not 8 | end 9 | -------------------------------------------------------------------------------- /spec/monkey_patches/publicize_methods.rb: -------------------------------------------------------------------------------- 1 | # Some monkey-patching to allow us to test private methods. 2 | class Class 3 | def publicize_methods(*methods) 4 | saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods 5 | 6 | self.class_eval { public(*saved_private_instance_methods) } 7 | yield 8 | self.class_eval { private(*saved_private_instance_methods) } 9 | end 10 | end 11 | 12 | -------------------------------------------------------------------------------- /spec/shared_behaviours/an_indirector_face.rb: -------------------------------------------------------------------------------- 1 | shared_examples_for "an indirector face" do 2 | [:find, :search, :save, :destroy, :info].each do |action| 3 | it { should be_action action } 4 | it { should respond_to action } 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/spec.opts: -------------------------------------------------------------------------------- 1 | --format 2 | s 3 | --colour 4 | --backtrace 5 | -------------------------------------------------------------------------------- /spec/unit/application/config_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/application/config' 4 | 5 | describe Puppet::Application::Config do 6 | it "should be a subclass of Puppet::Application::FaceBase" do 7 | Puppet::Application::Config.superclass.should equal(Puppet::Application::FaceBase) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/unit/face/catalog_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:catalog, '0.0.1'] do 6 | it "should actually have some testing..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face/certificate_request_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:certificate_request, '0.0.1'] do 6 | it "should actually have some tests..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face/certificate_revocation_list_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:certificate_revocation_list, '0.0.1'] do 6 | it "should actually have some tests..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face/file_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:file, '0.0.1'] do 6 | it_should_behave_like "an indirector face" 7 | 8 | [:download, :store].each do |action| 9 | it { should be_action action } 10 | it { should respond_to action } 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/unit/face/key_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:key, '0.0.1'] do 6 | it "should actually have some tests..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face/plugin_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:plugin, '0.0.1'] do 6 | [:download].each do |action| 7 | it { should be_action action } 8 | it { should respond_to action } 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/face/report_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:report, '0.0.1'] do 6 | it "should actually have some tests..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face/resource_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:resource, '0.0.1'] do 6 | it "should actually have some tests..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face/resource_type_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/face' 4 | 5 | describe Puppet::Face[:resource_type, '0.0.1'] do 6 | it "should actually have some tests..." 7 | end 8 | -------------------------------------------------------------------------------- /spec/unit/face_spec.rb: -------------------------------------------------------------------------------- 1 | # You should look at interface_spec.rb 2 | -------------------------------------------------------------------------------- /spec/unit/indirector/catalog/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/catalog/rest' 5 | 6 | describe Puppet::Resource::Catalog::Rest do 7 | it "should be a sublcass of Puppet::Indirector::REST" do 8 | Puppet::Resource::Catalog::Rest.superclass.should equal(Puppet::Indirector::REST) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/catalog/store_configs_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/node' 4 | require 'puppet/indirector/memory' 5 | require 'puppet/indirector/catalog/store_configs' 6 | 7 | class Puppet::Resource::Catalog::StoreConfigsTesting < Puppet::Indirector::Memory 8 | end 9 | 10 | describe Puppet::Resource::Catalog::StoreConfigs do 11 | after :each do 12 | Puppet::Resource::Catalog.indirection.reset_terminus_class 13 | Puppet::Resource::Catalog.indirection.cache_class = nil 14 | end 15 | 16 | it_should_behave_like "a StoreConfigs terminus" 17 | end 18 | -------------------------------------------------------------------------------- /spec/unit/indirector/certificate_request/file_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/certificate_request/file' 5 | 6 | describe Puppet::SSL::CertificateRequest::File do 7 | it "should have documentation" do 8 | Puppet::SSL::CertificateRequest::File.doc.should be_instance_of(String) 9 | end 10 | 11 | it "should use the :requestdir as the collection directory" do 12 | Puppet.settings.expects(:value).with(:requestdir).returns "/request/dir" 13 | Puppet::SSL::CertificateRequest::File.collection_directory.should == "/request/dir" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/unit/indirector/certificate_status/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/ssl/host' 4 | require 'puppet/indirector/certificate_status' 5 | 6 | describe "Puppet::CertificateStatus::Rest" do 7 | before do 8 | @terminus = Puppet::SSL::Host.indirection.terminus(:rest) 9 | end 10 | 11 | it "should be a terminus on Puppet::SSL::Host" do 12 | @terminus.should be_instance_of(Puppet::Indirector::CertificateStatus::Rest) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/indirector/facts/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/facts/rest' 5 | 6 | describe Puppet::Node::Facts::Rest do 7 | it "should be a sublcass of Puppet::Indirector::REST" do 8 | Puppet::Node::Facts::Rest.superclass.should equal(Puppet::Indirector::REST) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/facts/store_configs_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/node' 4 | require 'puppet/indirector/memory' 5 | require 'puppet/indirector/facts/store_configs' 6 | 7 | class Puppet::Node::Facts::StoreConfigsTesting < Puppet::Indirector::Memory 8 | end 9 | 10 | describe Puppet::Node::Facts::StoreConfigs do 11 | after :all do 12 | Puppet::Node::Facts.indirection.reset_terminus_class 13 | Puppet::Node::Facts.indirection.cache_class = nil 14 | end 15 | 16 | it_should_behave_like "a StoreConfigs terminus" 17 | end 18 | -------------------------------------------------------------------------------- /spec/unit/indirector/file_bucket_file/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_bucket_file/rest' 5 | 6 | describe Puppet::FileBucketFile::Rest do 7 | it "should be a sublcass of Puppet::Indirector::REST" do 8 | Puppet::FileBucketFile::Rest.superclass.should equal(Puppet::Indirector::REST) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/file_content/file_server_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_content/file_server' 5 | 6 | describe Puppet::Indirector::FileContent::FileServer do 7 | it "should be registered with the file_content indirection" do 8 | Puppet::Indirector::Terminus.terminus_class(:file_content, :file_server).should equal(Puppet::Indirector::FileContent::FileServer) 9 | end 10 | 11 | it "should be a subclass of the FileServer terminus" do 12 | Puppet::Indirector::FileContent::FileServer.superclass.should equal(Puppet::Indirector::FileServer) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/indirector/file_content/file_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_content/file' 5 | 6 | describe Puppet::Indirector::FileContent::File do 7 | it "should be registered with the file_content indirection" do 8 | Puppet::Indirector::Terminus.terminus_class(:file_content, :file).should equal(Puppet::Indirector::FileContent::File) 9 | end 10 | 11 | it "should be a subclass of the DirectFileServer terminus" do 12 | Puppet::Indirector::FileContent::File.superclass.should equal(Puppet::Indirector::DirectFileServer) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/indirector/file_content/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_content' 5 | 6 | describe "Puppet::Indirector::Content::Rest" do 7 | it "should add the node's cert name to the arguments" 8 | 9 | it "should set the content type to text/plain" 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/file_metadata/file_server_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_metadata/file_server' 5 | 6 | describe Puppet::Indirector::FileMetadata::FileServer do 7 | it "should be registered with the file_metadata indirection" do 8 | Puppet::Indirector::Terminus.terminus_class(:file_metadata, :file_server).should equal(Puppet::Indirector::FileMetadata::FileServer) 9 | end 10 | 11 | it "should be a subclass of the FileServer terminus" do 12 | Puppet::Indirector::FileMetadata::FileServer.superclass.should equal(Puppet::Indirector::FileServer) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/indirector/file_metadata/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/file_metadata' 5 | 6 | describe "Puppet::Indirector::Metadata::Rest" do 7 | it "should add the node's cert name to the arguments" 8 | end 9 | -------------------------------------------------------------------------------- /spec/unit/indirector/node/memory_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/node/memory' 5 | 6 | require 'shared_behaviours/memory_terminus' 7 | 8 | describe Puppet::Node::Memory do 9 | before do 10 | @name = "me" 11 | @searcher = Puppet::Node::Memory.new 12 | @instance = stub 'instance', :name => @name 13 | 14 | @request = stub 'request', :key => @name, :instance => @instance 15 | end 16 | 17 | it_should_behave_like "A Memory Terminus" 18 | end 19 | -------------------------------------------------------------------------------- /spec/unit/indirector/node/plain_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/node/plain' 5 | 6 | describe Puppet::Node::Plain do 7 | before do 8 | @searcher = Puppet::Node::Plain.new 9 | end 10 | 11 | it "should call node_merge() on the returned node" do 12 | node = mock 'node' 13 | Puppet::Node.expects(:new).with("mynode").returns(node) 14 | node.expects(:fact_merge) 15 | request = stub 'request', :key => "mynode" 16 | @searcher.find(request) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/unit/indirector/node/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/node/rest' 5 | 6 | describe Puppet::Node::Rest do 7 | before do 8 | @searcher = Puppet::Node::Rest.new 9 | end 10 | 11 | 12 | end 13 | -------------------------------------------------------------------------------- /spec/unit/indirector/node/store_configs_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/node' 4 | require 'puppet/indirector/node/store_configs' 5 | 6 | class Puppet::Node::StoreConfigsTesting < Puppet::Indirector::Memory 7 | end 8 | 9 | describe Puppet::Node::StoreConfigs do 10 | after :each do 11 | Puppet::Node.indirection.reset_terminus_class 12 | Puppet::Node.indirection.cache_class = nil 13 | end 14 | 15 | it_should_behave_like "a StoreConfigs terminus" 16 | end 17 | -------------------------------------------------------------------------------- /spec/unit/indirector/resource/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/resource/rest' 5 | 6 | describe Puppet::Resource::Rest do 7 | it "should be a sublcass of Puppet::Indirector::REST" do 8 | Puppet::Resource::Rest.superclass.should equal(Puppet::Indirector::REST) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/resource/store_configs_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | require 'puppet/resource' 4 | require 'puppet/indirector/memory' 5 | require 'puppet/indirector/resource/store_configs' 6 | 7 | class Puppet::Resource::StoreConfigsTesting < Puppet::Indirector::Memory 8 | end 9 | 10 | describe Puppet::Resource::StoreConfigs do 11 | it_should_behave_like "a StoreConfigs terminus" 12 | end 13 | -------------------------------------------------------------------------------- /spec/unit/indirector/resource_type/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/resource_type/rest' 5 | 6 | describe Puppet::Indirector::ResourceType::Rest do 7 | it "should be registered with the resource_type indirection" do 8 | Puppet::Indirector::Terminus.terminus_class(:resource_type, :rest).should equal(Puppet::Indirector::ResourceType::Rest) 9 | end 10 | 11 | it "should be a subclass of Puppet::Indirector::Rest" do 12 | Puppet::Indirector::ResourceType::Rest.superclass.should == Puppet::Indirector::REST 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /spec/unit/indirector/run/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/run/rest' 5 | 6 | describe Puppet::Run::Rest do 7 | it "should be a sublcass of Puppet::Indirector::REST" do 8 | Puppet::Run::Rest.superclass.should equal(Puppet::Indirector::REST) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/status/rest_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/status/rest' 5 | 6 | describe Puppet::Indirector::Status::Rest do 7 | it "should be a sublcass of Puppet::Indirector::REST" do 8 | Puppet::Indirector::Status::Rest.superclass.should equal(Puppet::Indirector::REST) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/unit/indirector/store_configs_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/indirector/store_configs' 5 | 6 | describe Puppet::Indirector::StoreConfigs do 7 | pending "REVISIT: creating an instance requires ludicrous amounts of stubbing, and there is relatively little to actually test here. What to do? Shared behaviours allow us to push down a lot of the testing into the implementation class tests anyhow..." 8 | end 9 | -------------------------------------------------------------------------------- /spec/unit/network/http/mongrel/xmlrpc_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/spec/unit/network/http/mongrel/xmlrpc_spec.rb -------------------------------------------------------------------------------- /spec/unit/network/http/webrick/xmlrpc_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/spec/unit/network/http/webrick/xmlrpc_spec.rb -------------------------------------------------------------------------------- /spec/unit/parser/ast/nop_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | describe Puppet::Parser::AST::Nop do 5 | 6 | before do 7 | @scope = mock 'scope' 8 | end 9 | 10 | it "should do nothing on evaluation" do 11 | Puppet::Parser::AST.expects(:safeevaluate).never 12 | Puppet::Parser::AST::Nop.new({}).evaluate(@scope) 13 | end 14 | 15 | it "should not return anything" do 16 | Puppet::Parser::AST::Nop.new({}).evaluate(@scope).should be_nil 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /spec/unit/property/ensure_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/property/ensure' 5 | 6 | klass = Puppet::Property::Ensure 7 | 8 | describe klass do 9 | it "should be a subclass of Property" do 10 | klass.superclass.must == Puppet::Property 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/unit/provider/cisco_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | require 'puppet/provider/cisco' 5 | 6 | describe Puppet::Provider::Cisco do 7 | it "should implement a device class method" do 8 | Puppet::Provider::Cisco.should respond_to(:device) 9 | end 10 | 11 | it "should create a cisco device instance" do 12 | Puppet::Util::NetworkDevice::Cisco::Device.expects(:new).returns :device 13 | Puppet::Provider::Cisco.device(:url).should == :device 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/unit/provider/selmodule-example.pp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/spec/unit/provider/selmodule-example.pp -------------------------------------------------------------------------------- /spec/unit/puppet/provider/README.markdown: -------------------------------------------------------------------------------- 1 | Provider Specs 2 | ============== 3 | 4 | Define specs for your providers under this directory. 5 | -------------------------------------------------------------------------------- /spec/unit/puppet/type/README.markdown: -------------------------------------------------------------------------------- 1 | Resource Type Specs 2 | =================== 3 | 4 | Define specs for your resource types in this directory. 5 | -------------------------------------------------------------------------------- /spec/unit/puppet_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec" 2 | 3 | require 'spec_helper' 4 | require 'puppet' 5 | 6 | describe Puppet do 7 | Puppet::Util::Log.eachlevel do |level| 8 | it "should have a method for sending '#{level}' logs" do 9 | Puppet.should respond_to(level) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/unit/transportable_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lak/puppet-old/368d4efa79d36ef3840694cc92e52920924810a9/spec/unit/transportable_spec.rb -------------------------------------------------------------------------------- /spec/unit/type/file/type.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | describe Puppet::Type.type(:file).attrclass(:type) do 5 | require 'puppet_spec/files' 6 | include PuppetSpec::Files 7 | 8 | before do 9 | @filename = tmpfile('type') 10 | @resource = Puppet::Type.type(:file).new({:name => @filename}) 11 | end 12 | 13 | it "should prevent the user from trying to set the type" do 14 | lambda { 15 | @resource[:type] = "fifo" 16 | }.should raise_error(Puppet::Error, /type is read-only/) 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /spec/unit/type/selmodule_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | describe Puppet::Type.type(:selmodule), "when validating attributes" do 5 | [:name, :selmoduledir, :selmodulepath].each do |param| 6 | it "should have a #{param} parameter" do 7 | Puppet::Type.type(:selmodule).attrtype(param).should == :param 8 | end 9 | end 10 | 11 | [:ensure, :syncversion].each do |param| 12 | it "should have a #{param} property" do 13 | Puppet::Type.type(:selmodule).attrtype(param).should == :property 14 | end 15 | end 16 | end 17 | 18 | -------------------------------------------------------------------------------- /spec/unit/type/stage_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | describe Puppet::Type.type(:stage) do 5 | it "should have a 'name' parameter'" do 6 | Puppet::Type.type(:stage).new(:name => :foo)[:name].should == :foo 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/unit/type/whit_spec.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rspec 2 | require 'spec_helper' 3 | 4 | whit = Puppet::Type.type(:whit).new(:name => "Foo::Bar") 5 | 6 | describe whit do 7 | it "should stringify in a way that users will regognise" do 8 | whit.to_s.should == "Foo::Bar" 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /tasks/rake/changelog.rake: -------------------------------------------------------------------------------- 1 | desc "Create a ChangeLog based on git commits." 2 | task :changelog do 3 | begin 4 | gitc = %x{which git-changelog} 5 | rescue 6 | puts "This task needs the git-changelog binary - http://github.com/ReinH/git-changelog" 7 | end 8 | 9 | CHANGELOG_DIR = "#{Dir.pwd}" 10 | mkdir(CHANGELOG_DIR) unless File.directory?(CHANGELOG_DIR) 11 | change_body = `git-changelog --limit=99999` 12 | File.open(File.join(CHANGELOG_DIR, "CHANGELOG"), 'w') do |f| 13 | f << change_body 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /tasks/rake/dailybuild.rake: -------------------------------------------------------------------------------- 1 | desc "Create a Puppet daily build" 2 | task :daily => :changelog do 3 | version = "puppet" + "-" + Time.now.localtime.strftime("%Y%m%d") 4 | sh "git archive --format=tar --prefix=#{version}/ HEAD^{tree} >#{version}.tar" 5 | sh "pax -waf #{version}.tar -s ':^:#{version}/:' ChangeLog" 6 | sh "rm ChangeLog" 7 | sh "gzip -f -9 #{version}.tar" 8 | end 9 | 10 | -------------------------------------------------------------------------------- /tasks/rake/metrics.rake: -------------------------------------------------------------------------------- 1 | begin 2 | require 'metric_fu' 3 | rescue LoadError 4 | # Metric-fu not installed 5 | # http://metric-fu.rubyforge.org/ 6 | end 7 | -------------------------------------------------------------------------------- /tasks/rake/sign.rake: -------------------------------------------------------------------------------- 1 | desc "Sign to the package with the Puppet Labs release key" 2 | task :sign_packages do 3 | 4 | version = Puppet::PUPPETVERSION 5 | 6 | # Sign package 7 | 8 | sh "gpg --homedir $HOME/pl_release_key --detach-sign --output pkg/puppet-#{version}.tar.gz.sign --armor pkg/puppet-#{version}.tar.gz" 9 | 10 | # Sign gem 11 | 12 | sh "gpg --homedir $HOME/pl_release_key --detach-sign --output pkg/puppet-#{version}.gem.sign --armor pkg/puppet-#{version}.gem" 13 | 14 | end 15 | -------------------------------------------------------------------------------- /tasks/rake/testbranch.rake: -------------------------------------------------------------------------------- 1 | desc "Rebuild the 'testng' branch" 2 | task :testbranch do 3 | TEST_SERIES = %x{git config --get puppet.testseriesfile}.chomp 4 | 5 | sh 'git checkout master' 6 | if %x{git branch}.split("\n").detect { |l| l =~ /\s+testing$/ } 7 | sh 'git branch -D testing' 8 | end 9 | sh 'git checkout -b testing' 10 | File.readlines(TEST_SERIES).each do |line| 11 | line.chomp! 12 | 13 | # Always create a commit for our merge 14 | sh "git merge --no-ff #{line}" 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /tasks/rake/yard.rake: -------------------------------------------------------------------------------- 1 | begin 2 | require 'yard' 3 | 4 | YARD::Rake::YardocTask.new do |t| 5 | t.files = ['lib/**/*.rb', 'spec/**/*.rb'] 6 | end 7 | 8 | rescue LoadError 9 | # yard not installed (gem install yard) 10 | # # http://yardoc.org 11 | end 12 | -------------------------------------------------------------------------------- /test/data/failers/badclassnoparam: -------------------------------------------------------------------------------- 1 | class comp() { 2 | file { "/etc/passwd": 3 | mode => 644 4 | } 5 | } 6 | 7 | # this argument is invalid, thus we should get a falure 8 | comp { 9 | fakearg => "yay" 10 | } 11 | -------------------------------------------------------------------------------- /test/data/failers/badclassparam: -------------------------------------------------------------------------------- 1 | class comp(arg1) { 2 | file { "/etc/passwd": 3 | mode => 644 4 | } 5 | } 6 | 7 | # i've specified an arg but it's an invalid one 8 | comp { 9 | fakearg => "yay" 10 | } 11 | -------------------------------------------------------------------------------- /test/data/failers/badcompnoparam: -------------------------------------------------------------------------------- 1 | define comp() { 2 | file { "/etc/passwd": 3 | mode => 644 4 | } 5 | } 6 | 7 | comp { 8 | fakearg => "yay" 9 | } 10 | -------------------------------------------------------------------------------- /test/data/failers/badcompparam: -------------------------------------------------------------------------------- 1 | define comp($arg1) { 2 | file { "/etc/passwd": 3 | mode => 644 4 | } 5 | } 6 | 7 | comp { 8 | fakearg => "yay" 9 | } 10 | -------------------------------------------------------------------------------- /test/data/failers/badtypeparam: -------------------------------------------------------------------------------- 1 | file { "/etc/passwd": 2 | fakeparam => 644 3 | } 4 | -------------------------------------------------------------------------------- /test/data/failers/noobjectrvalue: -------------------------------------------------------------------------------- 1 | $variable = file { "/etc/passwd": owner => root } 2 | -------------------------------------------------------------------------------- /test/data/providers/cron/crontab.allthree: -------------------------------------------------------------------------------- 1 | --- 2 | - | 3 | # comment 1 4 | # Puppet Name: name2 5 | env3=val 6 | * * * * * command4 7 | # comment 5 8 | 9 | - - :record_type: :comment 10 | :line: "# comment 1" 11 | - :command: command4 12 | :environment: 13 | - env3=val 14 | :name: name2 15 | :record_type: :crontab 16 | - :record_type: :comment 17 | :line: "# comment 5" 18 | -------------------------------------------------------------------------------- /test/data/providers/cron/crontab.envNcomment: -------------------------------------------------------------------------------- 1 | --- 2 | - | 3 | # comment 9 4 | env10=val 5 | * * * * * command11 6 | 7 | - - :record_type: :comment 8 | :line: "# comment 9" 9 | - :record_type: :environment 10 | :line: env10=val 11 | - :command: command11 12 | :record_type: :crontab 13 | -------------------------------------------------------------------------------- /test/data/providers/cron/crontab.envNname: -------------------------------------------------------------------------------- 1 | --- 2 | - | 3 | env6=val 4 | # Puppet Name: name7 5 | * * * * * command8 6 | 7 | - - :record_type: :environment 8 | :line: env6=val 9 | - :command: command8 10 | :record_type: :crontab 11 | :name: name7 12 | -------------------------------------------------------------------------------- /test/data/providers/cron/crontab.multirecords: -------------------------------------------------------------------------------- 1 | --- 2 | - | 3 | # comment 9 4 | env10=val 5 | * * * * * command11 6 | 7 | - - :record_type: :comment 8 | :line: "# comment 9" 9 | - :record_type: :environment 10 | :line: env10=val 11 | - :command: command11 12 | :record_type: :crontab 13 | -------------------------------------------------------------------------------- /test/data/providers/cron/examples/freebsd: -------------------------------------------------------------------------------- 1 | @daily /path/to/some/job 2 | @reboot /path/to/some/job 3 | -------------------------------------------------------------------------------- /test/data/providers/host/parsed/valid_hosts: -------------------------------------------------------------------------------- 1 | # Some leading comment, that should be ignored 2 | # The next line is empty so it should be ignored 3 | 4 | ::1 localhost 5 | 6 | # We now try another delimiter: Several tabs 7 | 127.0.0.1 localhost 8 | 9 | # No test trailing spaces 10 | 10.0.0.1 host1 11 | 12 | # Ok its time to test aliases 13 | 2001:252:0:1::2008:8 ipv6host alias1 14 | 192.168.0.1 ipv4host alias2 alias3 15 | 16 | # Testing inlinecomments now 17 | 192.168.0.2 host3 # This is host3 18 | 192.168.0.3 host4 alias10 # This is host4 19 | 192.168.0.4 host5 alias11 alias12 # This is host5 20 | -------------------------------------------------------------------------------- /test/data/providers/mount/parsed/aix.mount: -------------------------------------------------------------------------------- 1 | node mounted mounted over vfs date options 2 | ---- ------- ------------ --- ------------ ------------------- 3 | /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8 4 | /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8 5 | /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8 6 | /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8 7 | sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8 8 | -------------------------------------------------------------------------------- /test/data/providers/mount/parsed/darwin.mount: -------------------------------------------------------------------------------- 1 | /dev/disk0s2 on / (hfs, local, journaled) 2 | devfs on /dev (devfs, local, nobrowse) 3 | map -hosts on /net (autofs, nosuid, automounted, nobrowse) 4 | map auto_home on /home (autofs, automounted, nobrowse) 5 | /dev/disk0s3 on /usr (hfs, local, journaled) 6 | /dev/fake on /ghost (hfs, local, journaled) 7 | -------------------------------------------------------------------------------- /test/data/providers/mount/parsed/linux.mount: -------------------------------------------------------------------------------- 1 | /dev/root on / type jfs (rw,noatime) 2 | rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755) 3 | sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) 4 | /dev/sda9 on /usr/portage type jfs (rw) 5 | /dev/fake on /ghost type jfs (rw) 6 | -------------------------------------------------------------------------------- /test/data/providers/mount/parsed/solaris.mount: -------------------------------------------------------------------------------- 1 | / on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200000 on Mon Mar 18 08:48:45 2002 2 | /proc on /proc read/write/setuid/dev=4300000 on Mon Mar 18 08:48:44 2002 3 | /etc/mnttab on mnttab read/write/setuid/dev=43c0000 on Mon Mar 18 08:48:44 2002 4 | /tmp on swap read/write/setuid/xattr/dev=2 on Mon Mar 18 08:48:52 2002 5 | /export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 6 | /ghost on /dev/dsk/c0t1d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 7 | -------------------------------------------------------------------------------- /test/data/providers/ssh_authorized_key/parsed/authorized_keys2: -------------------------------------------------------------------------------- 1 | false ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz 2 | -------------------------------------------------------------------------------- /test/data/reports/tagmail_failers.conf: -------------------------------------------------------------------------------- 1 | tag: 2 | : abuse@domain.com 3 | invalid!tag: abuse@domain.com 4 | -------------------------------------------------------------------------------- /test/data/snippets/aliastest.pp: -------------------------------------------------------------------------------- 1 | file { "a file": 2 | path => "/tmp/aliastest", 3 | ensure => file 4 | } 5 | 6 | file { "another": 7 | path => "/tmp/aliastest2", 8 | ensure => file, 9 | require => File["a file"] 10 | } 11 | 12 | file { "a third": 13 | path => "/tmp/aliastest3", 14 | ensure => file, 15 | require => File["/tmp/aliastest"] 16 | } 17 | -------------------------------------------------------------------------------- /test/data/snippets/append.pp: -------------------------------------------------------------------------------- 1 | $var=['/tmp/file1','/tmp/file2'] 2 | 3 | class arraytest { 4 | $var += ['/tmp/file3', '/tmp/file4'] 5 | file { 6 | $var: 7 | content => "test" 8 | } 9 | } 10 | 11 | include arraytest 12 | -------------------------------------------------------------------------------- /test/data/snippets/argumentdefaults: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define testargs($file, $mode = 755) { 4 | file { $file: ensure => file, mode => $mode } 5 | } 6 | 7 | testargs { "testingname": 8 | file => "/tmp/argumenttest1" 9 | } 10 | 11 | testargs { "testingother": 12 | file => "/tmp/argumenttest2", 13 | mode => 644 14 | } 15 | -------------------------------------------------------------------------------- /test/data/snippets/arithmetic_expression.pp: -------------------------------------------------------------------------------- 1 | 2 | $one = 1.30 3 | $two = 2.034e-2 4 | 5 | $result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9) 6 | 7 | 8 | notice("result is $result == 1295.87692307692") -------------------------------------------------------------------------------- /test/data/snippets/arraytrailingcomma.pp: -------------------------------------------------------------------------------- 1 | file { 2 | ["/tmp/arraytrailingcomma1","/tmp/arraytrailingcomma2", ]: content => "tmp" 3 | } 4 | -------------------------------------------------------------------------------- /test/data/snippets/classheirarchy.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | class base { 4 | file { "/tmp/classheir1": ensure => file, mode => 755 } 5 | } 6 | 7 | class sub1 inherits base { 8 | file { "/tmp/classheir2": ensure => file, mode => 755 } 9 | } 10 | 11 | class sub2 inherits base { 12 | file { "/tmp/classheir3": ensure => file, mode => 755 } 13 | } 14 | 15 | include sub1, sub2 16 | -------------------------------------------------------------------------------- /test/data/snippets/classincludes.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | class base { 4 | file { "/tmp/classincludes1": ensure => file, mode => 755 } 5 | } 6 | 7 | class sub1 inherits base { 8 | file { "/tmp/classincludes2": ensure => file, mode => 755 } 9 | } 10 | 11 | class sub2 inherits base { 12 | file { "/tmp/classincludes3": ensure => file, mode => 755 } 13 | } 14 | 15 | $sub = "sub2" 16 | 17 | include sub1, $sub 18 | -------------------------------------------------------------------------------- /test/data/snippets/classpathtest: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define mytype { 4 | file { "/tmp/classtest": ensure => file, mode => 755 } 5 | } 6 | 7 | class testing { 8 | mytype { "componentname": } 9 | } 10 | 11 | include testing 12 | -------------------------------------------------------------------------------- /test/data/snippets/collection.pp: -------------------------------------------------------------------------------- 1 | class one { 2 | @file { "/tmp/colltest1": content => "one" } 3 | @file { "/tmp/colltest2": content => "two" } 4 | } 5 | 6 | class two { 7 | File <| content == "one" |> 8 | } 9 | 10 | include one, two 11 | -------------------------------------------------------------------------------- /test/data/snippets/collection_override.pp: -------------------------------------------------------------------------------- 1 | @file { 2 | "/tmp/collection": 3 | content => "whatever" 4 | } 5 | 6 | File<| |> { 7 | mode => 0600 8 | } 9 | -------------------------------------------------------------------------------- /test/data/snippets/collection_within_virtual_definitions.pp: -------------------------------------------------------------------------------- 1 | define test($name) { 2 | file {"/tmp/collection_within_virtual_definitions1_$name.txt": 3 | content => "File name $name\n" 4 | } 5 | Test2 <||> 6 | } 7 | 8 | define test2() { 9 | file {"/tmp/collection_within_virtual_definitions2_$name.txt": 10 | content => "This is a test\n" 11 | } 12 | } 13 | 14 | node default { 15 | @test {"foo": 16 | name => "foo" 17 | } 18 | @test2 {"foo2": } 19 | Test <||> 20 | } 21 | -------------------------------------------------------------------------------- /test/data/snippets/componentmetaparams.pp: -------------------------------------------------------------------------------- 1 | file { "/tmp/component1": 2 | ensure => file 3 | } 4 | 5 | define thing { 6 | file { $name: ensure => file } 7 | } 8 | 9 | thing { "/tmp/component2": 10 | require => File["/tmp/component1"] 11 | } 12 | -------------------------------------------------------------------------------- /test/data/snippets/componentrequire.pp: -------------------------------------------------------------------------------- 1 | define testfile($mode) { 2 | file { $name: mode => $mode, ensure => present } 3 | } 4 | 5 | testfile { "/tmp/testing_component_requires2": mode => 755 } 6 | 7 | file { "/tmp/testing_component_requires1": mode => 755, ensure => present, 8 | require => Testfile["/tmp/testing_component_requires2"] } 9 | -------------------------------------------------------------------------------- /test/data/snippets/deepclassheirarchy.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | class base { 4 | file { "/tmp/deepclassheir1": ensure => file, mode => 755 } 5 | } 6 | 7 | class sub1 inherits base { 8 | file { "/tmp/deepclassheir2": ensure => file, mode => 755 } 9 | } 10 | 11 | class sub2 inherits sub1 { 12 | file { "/tmp/deepclassheir3": ensure => file, mode => 755 } 13 | } 14 | 15 | class sub3 inherits sub2 { 16 | file { "/tmp/deepclassheir4": ensure => file, mode => 755 } 17 | } 18 | 19 | class sub4 inherits sub3 { 20 | file { "/tmp/deepclassheir5": ensure => file, mode => 755 } 21 | } 22 | 23 | include sub4 24 | -------------------------------------------------------------------------------- /test/data/snippets/defineoverrides.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $file = "/tmp/defineoverrides1" 4 | 5 | define myfile($mode) { 6 | file { $name: ensure => file, mode => $mode } 7 | } 8 | 9 | class base { 10 | myfile { $file: mode => 644 } 11 | } 12 | 13 | class sub inherits base { 14 | Myfile[$file] { mode => 755, } # test the end-comma 15 | } 16 | 17 | include sub 18 | -------------------------------------------------------------------------------- /test/data/snippets/emptyclass.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | define component { 4 | } 5 | 6 | class testing { 7 | } 8 | 9 | include testing 10 | -------------------------------------------------------------------------------- /test/data/snippets/emptyexec.pp: -------------------------------------------------------------------------------- 1 | exec { "touch /tmp/emptyexectest": 2 | path => "/usr/bin:/bin" 3 | } 4 | -------------------------------------------------------------------------------- /test/data/snippets/emptyifelse.pp: -------------------------------------------------------------------------------- 1 | 2 | if false { 3 | } else { 4 | # nothing here 5 | } 6 | 7 | if true { 8 | # still nothing 9 | } 10 | -------------------------------------------------------------------------------- /test/data/snippets/falsevalues.pp: -------------------------------------------------------------------------------- 1 | $value = false 2 | 3 | file { "/tmp/falsevalues$value": ensure => file } 4 | -------------------------------------------------------------------------------- /test/data/snippets/filecreate: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { 4 | "/tmp/createatest": ensure => file, mode => 755; 5 | "/tmp/createbtest": ensure => file, mode => 755 6 | } 7 | 8 | file { 9 | "/tmp/createctest": ensure => file; 10 | "/tmp/createdtest": ensure => file; 11 | } 12 | -------------------------------------------------------------------------------- /test/data/snippets/fqdefinition.pp: -------------------------------------------------------------------------------- 1 | define one::two($ensure) { 2 | file { "/tmp/fqdefinition": ensure => $ensure } 3 | } 4 | 5 | one::two { "/tmp/fqdefinition": ensure => file } 6 | -------------------------------------------------------------------------------- /test/data/snippets/fqparents.pp: -------------------------------------------------------------------------------- 1 | class base { 2 | class one { 3 | file { "/tmp/fqparent1": ensure => file } 4 | } 5 | } 6 | 7 | class two::three inherits base::one { 8 | file { "/tmp/fqparent2": ensure => file } 9 | } 10 | 11 | include two::three 12 | -------------------------------------------------------------------------------- /test/data/snippets/funccomma.pp: -------------------------------------------------------------------------------- 1 | @file { 2 | ["/tmp/funccomma1","/tmp/funccomma2"]: content => "1" 3 | } 4 | 5 | realize( File["/tmp/funccomma1"], File["/tmp/funccomma2"] , ) 6 | -------------------------------------------------------------------------------- /test/data/snippets/ifexpression.pp: -------------------------------------------------------------------------------- 1 | $one = 1 2 | $two = 2 3 | 4 | if ($one < $two) and (($two < 3) or ($two == 2)) { 5 | notice("True!") 6 | } 7 | 8 | if "test regex" =~ /(.*) regex/ { 9 | file { 10 | "/tmp/${1}iftest": ensure => file, mode => 0755 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/data/snippets/implicititeration: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $files = ["/tmp/iterationatest", "/tmp/iterationbtest"] 4 | 5 | file { $files: ensure => file, mode => 755 } 6 | 7 | file { ["/tmp/iterationctest", "/tmp/iterationdtest"]: 8 | ensure => file, 9 | mode => 755 10 | } 11 | 12 | file { 13 | ["/tmp/iterationetest", "/tmp/iterationftest"]: ensure => file, mode => 755; 14 | ["/tmp/iterationgtest", "/tmp/iterationhtest"]: ensure => file, mode => 755; 15 | } 16 | -------------------------------------------------------------------------------- /test/data/snippets/multilinecomments.pp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | file { 4 | "/tmp/multilinecomments": content => "pouet" 5 | } 6 | */ 7 | 8 | /* and another one for #2333, the whitespace after the 9 | end comment is here on purpose */ 10 | 11 | -------------------------------------------------------------------------------- /test/data/snippets/multipleclass.pp: -------------------------------------------------------------------------------- 1 | class one { 2 | file { "/tmp/multipleclassone": content => "one" } 3 | } 4 | 5 | class one { 6 | file { "/tmp/multipleclasstwo": content => "two" } 7 | } 8 | 9 | include one 10 | -------------------------------------------------------------------------------- /test/data/snippets/multipleinstances: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { 4 | "/tmp/multipleinstancesa": ensure => file, mode => 755; 5 | "/tmp/multipleinstancesb": ensure => file, mode => 755; 6 | "/tmp/multipleinstancesc": ensure => file, mode => 755; 7 | } 8 | -------------------------------------------------------------------------------- /test/data/snippets/multisubs.pp: -------------------------------------------------------------------------------- 1 | class base { 2 | file { "/tmp/multisubtest": content => "base", mode => 644 } 3 | } 4 | 5 | class sub1 inherits base { 6 | File["/tmp/multisubtest"] { mode => 755 } 7 | } 8 | 9 | class sub2 inherits base { 10 | File["/tmp/multisubtest"] { content => sub2 } 11 | } 12 | 13 | include sub1, sub2 14 | -------------------------------------------------------------------------------- /test/data/snippets/namevartest: -------------------------------------------------------------------------------- 1 | define filetest($mode, $ensure = file) { 2 | file { $name: 3 | mode => $mode, 4 | ensure => $ensure 5 | } 6 | } 7 | 8 | filetest { "/tmp/testfiletest": mode => 644} 9 | filetest { "/tmp/testdirtest": mode => 755, ensure => directory} 10 | -------------------------------------------------------------------------------- /test/data/snippets/scopetest: -------------------------------------------------------------------------------- 1 | 2 | $mode = 640 3 | 4 | define thing { 5 | file { "/tmp/$name": ensure => file, mode => $mode } 6 | } 7 | 8 | class testing { 9 | $mode = 755 10 | thing {scopetest: } 11 | } 12 | 13 | include testing 14 | -------------------------------------------------------------------------------- /test/data/snippets/simpledefaults: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | File { mode => 755 } 4 | 5 | file { "/tmp/defaulttest": ensure => file } 6 | -------------------------------------------------------------------------------- /test/data/snippets/singleary.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { "/tmp/singleary1": 4 | ensure => file 5 | } 6 | 7 | file { "/tmp/singleary2": 8 | ensure => file 9 | } 10 | 11 | file { "/tmp/singleary3": 12 | ensure => file, 13 | require => [File["/tmp/singleary1"], File["/tmp/singleary2"]] 14 | } 15 | 16 | file { "/tmp/singleary4": 17 | ensure => file, 18 | require => [File["/tmp/singleary1"]] 19 | } 20 | -------------------------------------------------------------------------------- /test/data/snippets/singlequote.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | file { "/tmp/singlequote1": 4 | ensure => file, 5 | content => 'a $quote' 6 | } 7 | 8 | file { "/tmp/singlequote2": 9 | ensure => file, 10 | content => 'some "\yayness\"' 11 | } 12 | -------------------------------------------------------------------------------- /test/data/snippets/singleselector.pp: -------------------------------------------------------------------------------- 1 | $value1 = "" 2 | $value2 = true 3 | $value3 = false 4 | $value4 = yay 5 | 6 | $test = "yay" 7 | 8 | $mode1 = $value1 ? { 9 | "" => 755 10 | } 11 | 12 | $mode2 = $value2 ? { 13 | true => 755 14 | } 15 | 16 | $mode3 = $value3 ? { 17 | default => 755 18 | } 19 | 20 | file { "/tmp/singleselector1": ensure => file, mode => $mode1 } 21 | file { "/tmp/singleselector2": ensure => file, mode => $mode2 } 22 | file { "/tmp/singleselector3": ensure => file, mode => $mode3 } 23 | -------------------------------------------------------------------------------- /test/data/snippets/subclass_name_duplication.pp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env puppet 2 | 3 | class one::fake { 4 | file { "/tmp/subclass_name_duplication1": ensure => present } 5 | } 6 | 7 | class two::fake { 8 | file { "/tmp/subclass_name_duplication2": ensure => present } 9 | } 10 | 11 | include one::fake, two::fake 12 | -------------------------------------------------------------------------------- /test/data/snippets/tag.pp: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | $variable = value 4 | 5 | tag yayness, rahness 6 | 7 | tag booness, $variable 8 | 9 | file { "/tmp/settestingness": ensure => file } 10 | -------------------------------------------------------------------------------- /test/data/snippets/virtualresources.pp: -------------------------------------------------------------------------------- 1 | class one { 2 | @file { "/tmp/virtualtest1": content => "one" } 3 | @file { "/tmp/virtualtest2": content => "two" } 4 | @file { "/tmp/virtualtest3": content => "three" } 5 | @file { "/tmp/virtualtest4": content => "four" } 6 | } 7 | 8 | class two { 9 | File <| content == "one" |> 10 | realize File["/tmp/virtualtest2"] 11 | realize(File["/tmp/virtualtest3"], File["/tmp/virtualtest4"]) 12 | } 13 | 14 | include one, two 15 | -------------------------------------------------------------------------------- /test/data/types/hosts/1: -------------------------------------------------------------------------------- 1 | # Do not remove the following line, or various programs 2 | # that require network functionality will fail. 3 | 127.0.0.1 hostname.domain.net hostname localhost.localdomain localhost 4 | -------------------------------------------------------------------------------- /test/data/types/hosts/2: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | 192.168.0.3 culain.madstop.com culain 3 | 192.168.0.100 yaytest 4 | 5 | # The following lines are desirable for IPv6 capable hosts 6 | # (added automatically by netbase upgrade) 7 | 8 | ::1 ip6-localhost ip6-loopback 9 | fe00::0 ip6-localnet 10 | ff00::0 ip6-mcastprefix 11 | ff02::1 ip6-allnodes 12 | ff02::2 ip6-allrouters 13 | ff02::3 ip6-allhosts 14 | -------------------------------------------------------------------------------- /test/data/types/hosts/solaris: -------------------------------------------------------------------------------- 1 | # 2 | # Internet host table 3 | # 4 | 127.0.0.1 localhost 5 | 192.168.0.50 sol10b 6 | -------------------------------------------------------------------------------- /test/data/types/mount/freebsd.fstab: -------------------------------------------------------------------------------- 1 | # Device Mountpoint FStype Options Dump Pass# 2 | /dev/ad0s1b none swap sw 0 0 3 | /dev/ad0s1a / ufs rw 1 1 4 | /dev/ad0s1e /tmp ufs rw 2 2 5 | /dev/ad0s1f /usr ufs rw 2 2 6 | /dev/ad0s1d /var ufs rw 2 2 7 | /dev/acd0 /cdrom cd9660 ro,noauto 0 0 8 | -------------------------------------------------------------------------------- /test/data/types/yumrepos/fedora.repo: -------------------------------------------------------------------------------- 1 | [base] 2 | name=Fedora Core $releasever - $basearch - Base 3 | mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever 4 | enabled=1 5 | gpgcheck=1 6 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora 7 | exclude=foo 8 | bar 9 | baz 10 | -------------------------------------------------------------------------------- /test/lib/puppettest/railstesting.rb: -------------------------------------------------------------------------------- 1 | module PuppetTest::RailsTesting 2 | Parser = Puppet::Parser 3 | AST = Puppet::Parser::AST 4 | include PuppetTest::ParserTesting 5 | 6 | def teardown 7 | super 8 | 9 | # If we don't clean up the connection list, then the rails 10 | # lib will still think it's connected. 11 | ActiveRecord::Base.clear_active_connections! if Puppet.features.rails? 12 | end 13 | 14 | def railsinit 15 | Puppet::Rails.init 16 | end 17 | end 18 | 19 | -------------------------------------------------------------------------------- /test/lib/puppettest/reporttesting.rb: -------------------------------------------------------------------------------- 1 | module PuppetTest::Reporttesting 2 | def fakereport 3 | # Create a bunch of log messages in an array. 4 | report = Puppet::Transaction::Report.new("apply") 5 | 6 | 3.times { |i| 7 | # We have to use warning so that the logs always happen 8 | log = Puppet.warning("Report test message #{i}") 9 | 10 | report << log 11 | } 12 | 13 | report 14 | end 15 | end 16 | 17 | -------------------------------------------------------------------------------- /test/lib/puppettest/support.rb: -------------------------------------------------------------------------------- 1 | require 'puppettest' 2 | 3 | module PuppetTest::Support 4 | end 5 | 6 | require 'puppettest/support/assertions' 7 | require 'puppettest/support/helpers' 8 | require 'puppettest/support/utils' 9 | -------------------------------------------------------------------------------- /test/lib/puppettest/support/helpers.rb: -------------------------------------------------------------------------------- 1 | require 'puppettest' 2 | 3 | module PuppetTest 4 | # NOTE: currently both of these will produce bogus results on Darwin due to the wonderful 5 | # UID of nobody. 6 | def nonrootuser 7 | Etc.passwd { |user| 8 | return user if user.uid != Puppet::Util::SUIDManager.uid and user.uid > 0 and user.uid < 255 9 | } 10 | end 11 | 12 | def nonrootgroup 13 | Etc.group { |group| 14 | return group if group.gid != Puppet::Util::SUIDManager.gid and group.gid > 0 and group.gid < 255 15 | } 16 | end 17 | end 18 | 19 | -------------------------------------------------------------------------------- /test/lib/rake/puppet_test_loader.rb: -------------------------------------------------------------------------------- 1 | 2 | require 'test/unit/autorunner' 3 | require 'getoptlong' 4 | require 'puppettest' 5 | 6 | args = PuppetTest.munge_argv 7 | 8 | args.each { |f| require f unless f =~ /^-/ } 9 | 10 | runner = Test::Unit::AutoRunner.new(false) 11 | runner.process_args 12 | 13 | exit 14 unless runner.run 14 | 15 | -------------------------------------------------------------------------------- /test/lib/rake/puppet_testtask.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'rake' 4 | require 'rake/testtask' 5 | 6 | module Rake 7 | class PuppetTestTask < Rake::TestTask 8 | def rake_loader 9 | if Integer(RUBY_VERSION.split(/\./)[2]) < 4 10 | file = super 11 | else 12 | file = find_file('rake/puppet_test_loader') or 13 | fail "unable to find rake test loader" 14 | end 15 | file 16 | end 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /test/lib/stubba.rb: -------------------------------------------------------------------------------- 1 | # for backwards compatibility 2 | require 'mocha' 3 | -------------------------------------------------------------------------------- /test/puppet/errortest.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require File.expand_path(File.dirname(__FILE__) + '/../lib/puppettest') 4 | 5 | require 'puppet' 6 | require 'puppettest' 7 | 8 | class TestError < Test::Unit::TestCase 9 | include PuppetTest 10 | 11 | def test_errorisstring 12 | error = nil 13 | assert_nothing_raised { 14 | error = Puppet::ParseError.new("This is an error") 15 | } 16 | assert_instance_of(String, error.to_s) 17 | end 18 | end 19 | 20 | --------------------------------------------------------------------------------