Skip to content

Instantly share code, notes, and snippets.

View Magisus's full-sized avatar

Maggie Dreyer Magisus

  • Puppet, Inc.
  • Portland, OR
View GitHub Profile
@Magisus
Magisus / gist:d209c31ccf8cf33ac11881d9bd4f035e
Last active September 24, 2020 17:33
Building a pe-puppetserver uberjar with a dev dependency
On branches for Marshall and beyond*:
1. Make changes to dependent project (no commit necessary)
2. Run `lein clean && lein install` in that project dir, will put a SNAPSHOT version in your local maven repo
3. Update the entry for the dep in the `project.clj` file of pe-puppet-server-extenions to point to that installed SNAPSHOT version
4. Run `lein clean && lein uberjar` in pe-puppet-server-extensions. This creates a new `puppet-server-release.jar` in `target`
5. Copy the jar to your PE box:
`scp target/puppet-server-release.jar [email protected]:/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar`
6. On that box, restart pe-puppetserver
@Magisus
Magisus / stack1.txt
Last active February 23, 2021 16:40
Puppet Multithreaded deadlock
- waiting to lock <0x000000009549a9f8> (a org.jruby.gen.RubyObject6)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.invokeOther14:load(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:116)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.RUBY$method$internal_call_function$0(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:116)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.invokeOther1:internal_call_function(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:74)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.function.RUBY$method$call_function$0(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:74)
at opt.puppetlabs.puppet.lib.ruby.vendor_ruby.puppet.pops.functions.dispatch.invokeOther6:send(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/dispatch.rb:60)
at opt.puppet
@Magisus
Magisus / orch_tests.txt
Created July 22, 2021 21:49
Running orchestrator tests
1. Install/update Docker Desktop
2. Clone https://github.com/steveax/docker-pglogical and follow its readme instructions
3. Run `./dev-setup` in the orchestrator repo, which will create all the relevant DB fixtures
4. Run `lein test`
Nick Lewis does:
`docker run --rm --name=orchestrator_test --env POSTGRES_PASSWORD=docker --detach \
--publish 5432:5432 postgres -c max-connections=200`
and
`PGHOST=localhost PGPASSWORD=docker ./dev-setup`
@Magisus
Magisus / build_and_install.txt
Last active July 28, 2021 18:27
Building and installing FOSS puppetserver
Before you begin, you'll need:
* leiningen (https://leiningen.org/)
* Java 8
* A clone of puppetserver with your changes made (they don't need to be committed for this)
1. In the puppetserver repo, build a new package with ezbake. You can create a Jenkins token by going to your profile on https://jenkins-platform.delivery.puppetlabs.net/ and generating one, then copying it into this command, along with your LDAP username.
=> lein clean && lein install && EZBAKE_ALLOW_UNREPRODUCIBLE_BUILDS=true EZBAKE_NODEPLOY=true JENKINS_USER_AUTH="<jenkins username>:<platform jenkins user token>" lein with-profile ezbake,provided ezbake build
2. The end of the output will link to a specific folder in http://builds.delivery.puppetlabs.net/puppetserver/. Your artifacts will appear here when Jenkins has finished building them.
[2022-07-01T16:14:11.855Z] === FAIL: internal/jobs (0.00s)
[2022-07-01T16:14:11.855Z] time="2022-07-01T16:03:03Z" level=info msg="No config found in KV - proceeding" func=github.com/puppetlabs/data-ingestion/internal/config/manager.ConfigManager.Load file="/home/jenkins/agent/workspace/pipeline_hdp_core_PR-617/internal/config/manager/lib.go:150"
[2022-07-01T16:14:11.855Z] time="2022-07-01T16:07:49Z" level=info msg="Get \"http://127.0.0.1:49153/\": read tcp 127.0.0.1:46582->127.0.0.1:49153: read: connection reset by peer" func="github.com/puppetlabs/data-ingestion/internal/test_utils/elasticsearch.(*ElasticSearchInstance).Open" file="/home/jenkins/agent/workspace/pipeline_hdp_core_PR-617/internal/test_utils/elasticsearch/lib.go:91"
[2022-07-01T16:14:11.856Z] time="2022-07-01T16:07:50Z" level=info msg="Get \"http://127.0.0.1:49153/\": read tcp 127.0.0.1:46598->127.0.0.1:49153: read: connection reset by peer" func="github.com/puppetlabs/data-ingestion/internal/test_utils/elasticsearch.(*ElasticSearchInstance
@Magisus
Magisus / generate_certificates.rb
Created May 21, 2024 19:04
Generate a CA certificate chain
require 'openssl'
require 'resolv'
# The minimum recommended length is 2048, 4096 is more future-proof
PRIVATE_KEY_LENGTH = 2048
# Used for cert expiration periods. 15 years is chosen arbitrarily,
# long enough that users won't have to deal with refreshing for
# a while. The `regen_certificates` plan can be used to refresh
# certs if needed.