Skip to content

Instantly share code, notes, and snippets.

@kbarber
Created July 1, 2015 13:25
Show Gist options
  • Save kbarber/f61a654f7cc9b74714e2 to your computer and use it in GitHub Desktop.
Save kbarber/f61a654f7cc9b74714e2 to your computer and use it in GitHub Desktop.
[root@el7-64-1 system]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for el7-64-1.us-west-2.compute.internal
Info: Applying configuration version '1435756396'
Notice: /Stage[main]/Postgresql::Server::Config/File[systemd-override]/content:
--- /etc/systemd/system/postgresql-9.4.service 2015-07-01 12:59:30.841528530 +0000
+++ /tmp/puppet-file20150701-21356-asuwv3 2015-07-01 13:13:20.606249074 +0000
@@ -1,4 +1,4 @@
-.include /lib/systemd/system/postgresql-9.4.service
+.include /lib/systemd/system/postgresql.service
[Service]
Environment=PGPORT=5432
Environment=PGDATA=/var/lib/pgsql/9.4/data
Info: Computing checksum on file /etc/systemd/system/postgresql-9.4.service
Info: /Stage[main]/Postgresql::Server::Config/File[systemd-override]: Filebucketed /etc/systemd/system/postgresql-9.4.service to puppet with sum db07bbf61d51a2a6e7be14aa6f251148
Notice: /Stage[main]/Postgresql::Server::Config/File[systemd-override]/content: content changed '{md5}db07bbf61d51a2a6e7be14aa6f251148' to '{md5}197695e8b2c277c2601acb544ecbc2f8'
Info: /Stage[main]/Postgresql::Server::Config/File[systemd-override]: Scheduling refresh of Exec[restart-systemd]
Info: /Stage[main]/Postgresql::Server::Config/File[systemd-override]: Scheduling refresh of Class[Postgresql::Server::Service]
Notice: /Stage[main]/Postgresql::Server::Config/Exec[restart-systemd]: Triggered 'refresh' from 1 events
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Anchor[postgresql::server::service::begin]
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Service[postgresqld]
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Postgresql::Validate_db_connection[validate_service_is_running]
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Anchor[postgresql::server::service::end]
Notice: /Stage[main]/Postgresql::Server::Service/Anchor[postgresql::server::service::begin]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Postgresql::Server::Service/Service[postgresqld]/enable: enable changed 'false' to 'true'
Error: /Stage[main]/Postgresql::Server::Service/Service[postgresqld]: Failed to call refresh: Could not restart Service[postgresqld]: Execution of '/usr/bin/systemctl restart postgresql-9.4' returned 6: Failed to issue method call: Unit postgresql-9.4.service failed to load: Invalid argument. See system logs and 'systemctl status postgresql-9.4.service' for details.
Error: /Stage[main]/Postgresql::Server::Service/Service[postgresqld]: Could not restart Service[postgresqld]: Execution of '/usr/bin/systemctl restart postgresql-9.4' returned 6: Failed to issue method call: Unit postgresql-9.4.service failed to load: Invalid argument. See system logs and 'systemctl status postgresql-9.4.service' for details.
Info: Postgresql::Validate_db_connection[validate_service_is_running]: Scheduling refresh of Exec[validate postgres connection for @:5432/postgres]
Notice: /Stage[main]/Postgresql::Server::Service/Postgresql::Validate_db_connection[validate_service_is_running]/Exec[validate postgres connection for @:5432/postgres]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Postgresql::Server::Service/Anchor[postgresql::server::service::end]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Role[puppetdb]/Postgresql_psql[CREATE ROLE puppetdb ENCRYPTED PASSWORD ****]/command: command changed 'notrun' to 'CREATE ROLE "puppetdb" ENCRYPTED PASSWORD '$NEWPGPASSWD' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER CONNECTION LIMIT -1'
Notice: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Database[puppetdb]/Postgresql_psql[Check for existence of db 'puppetdb']/command: command changed 'notrun' to 'SELECT 1'
Info: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Database[puppetdb]/Postgresql_psql[Check for existence of db 'puppetdb']: Scheduling refresh of Exec[/usr/pgsql-9.4/bin/createdb --port='5432' --owner='postgres' --template=template0 'puppetdb']
Notice: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Database[puppetdb]/Exec[/usr/pgsql-9.4/bin/createdb --port='5432' --owner='postgres' --template=template0 'puppetdb']: Triggered 'refresh' from 1 events
Info: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Database[puppetdb]/Exec[/usr/pgsql-9.4/bin/createdb --port='5432' --owner='postgres' --template=template0 'puppetdb']: Scheduling refresh of Postgresql_psql[REVOKE CONNECT ON DATABASE "puppetdb" FROM public]
Notice: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Database[puppetdb]/Postgresql_psql[REVOKE CONNECT ON DATABASE "puppetdb" FROM public]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Main/Postgresql::Server::Db[puppetdb]/Postgresql::Server::Database_grant[GRANT puppetdb - all - puppetdb]/Postgresql::Server::Grant[database:GRANT puppetdb - all - puppetdb]/Postgresql_psql[grant:database:GRANT puppetdb - all - puppetdb]/command: command changed 'notrun' to 'GRANT ALL ON DATABASE "puppetdb" TO
"puppetdb"'
Notice: Applied catalog in 1.38 seconds
[root@el7-64-1 system]# pwd
/etc/systemd/system
[root@el7-64-1 system]# cd /etc/puppetlabs/code/
environments/ hieradata/ hiera.yaml modules/
[root@el7-64-1 system]# cd /etc/puppetlabs/code/environments/production/
environment.conf manifests/ modules/
[root@el7-64-1 system]# cd /etc/puppetlabs/code/environments/production/modules/
apt/ concat/ firewall/ inifile/ postgresql/ puppetdb/ stdlib/
[root@el7-64-1 system]# cd /etc/puppetlabs/code/environments/production/modules/
[root@el7-64-1 modules]# ls
apt concat firewall inifile postgresql puppetdb stdlib
[root@el7-64-1 modules]# vi postgresql/
CHANGELOG.md CONTRIBUTING.md Gemfile LICENSE metadata.json Rakefile spec/
checksums.json files/ lib/ manifests/ NOTICE README.md templates/
[root@el7-64-1 modules]# vi postgresql/manifests/
client.pp lib/ repo/ server/ validate_db_connection.pp
globals.pp params.pp repo.pp server.pp
[root@el7-64-1 modules]# vi postgresql/manifests/server/config.pp
[root@el7-64-1 modules]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for el7-64-1.us-west-2.compute.internal
Info: Applying configuration version '1435756450'
Notice: /Stage[main]/Postgresql::Server::Config/File[systemd-override]/content:
--- /etc/systemd/system/postgresql-9.4.service 2015-07-01 13:13:20.640248244 +0000
+++ /tmp/puppet-file20150701-21559-fulnvu 2015-07-01 13:14:13.055967517 +0000
@@ -1,4 +1,4 @@
-.include /lib/systemd/system/postgresql.service
+.include /lib/systemd/system/postgresql-9.4.service
[Service]
Environment=PGPORT=5432
Environment=PGDATA=/var/lib/pgsql/9.4/data
Info: Computing checksum on file /etc/systemd/system/postgresql-9.4.service
Info: /Stage[main]/Postgresql::Server::Config/File[systemd-override]: Filebucketed /etc/systemd/system/postgresql-9.4.service to puppet with sum 197695e8b2c277c2601acb544ecbc2f8
Notice: /Stage[main]/Postgresql::Server::Config/File[systemd-override]/content: content changed '{md5}197695e8b2c277c2601acb544ecbc2f8' to '{md5}db07bbf61d51a2a6e7be14aa6f251148'
Info: /Stage[main]/Postgresql::Server::Config/File[systemd-override]: Scheduling refresh of Exec[restart-systemd]
Info: /Stage[main]/Postgresql::Server::Config/File[systemd-override]: Scheduling refresh of Class[Postgresql::Server::Service]
Notice: /Stage[main]/Postgresql::Server::Config/Exec[restart-systemd]: Triggered 'refresh' from 1 events
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Anchor[postgresql::server::service::begin]
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Service[postgresqld]
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Postgresql::Validate_db_connection[validate_service_is_running]
Info: Class[Postgresql::Server::Service]: Scheduling refresh of Anchor[postgresql::server::service::end]
Notice: /Stage[main]/Postgresql::Server::Service/Anchor[postgresql::server::service::begin]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Postgresql::Server::Service/Service[postgresqld]/enable: enable changed 'false' to 'true'
Notice: /Stage[main]/Postgresql::Server::Service/Service[postgresqld]: Triggered 'refresh' from 1 events
Info: Postgresql::Validate_db_connection[validate_service_is_running]: Scheduling refresh of Exec[validate postgres connection for @:5432/postgres]
Notice: /Stage[main]/Postgresql::Server::Service/Postgresql::Validate_db_connection[validate_service_is_running]/Exec[validate postgres connection for @:5432/postgres]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Postgresql::Server::Service/Anchor[postgresql::server::service::end]: Triggered 'refresh' from 1 events
Notice: Applied catalog in 2.86 seconds
[root@el7-64-1 modules]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment