Skip to content

Instantly share code, notes, and snippets.

$ mgmt run --tmp-prefix lang examples/lang/os.mcl
2020-02-09 19:11:39.566679 I | cli: lang: lexing/parsing...
2020-02-09 19:11:39.602894 I | cli: lang: init...
2020-02-09 19:11:39.603889 I | cli: lang: interpolating...
2020-02-09 19:11:39.606002 I | cli: lang: building scope...
2020-02-09 19:11:39.610499 I | run: error: cli parse error: could not set scope: import scope `golang/exec` failed: system import of `golang/exec` failed: could not find any non-empty scope named: golang/exec
$ $ uname -a
Linux dev-app01-ffrank 4.4.0-140-generic #166-Ubuntu SMP Wed Nov 14 20:09:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
root@dev-app01-ffrank:/home/demo/git/presentations/2020-02-puppet-from-mgmt-on-overdrive# cat demo3/supported.mcl
pkg "haproxy" {
state => "installed",
}
file "/etc/haproxy/haproxy.conf" {
mode => "0640",
}
demo@dev-app01-ffrank:/tmp/mgmt$ git clone --recursive https://github.com/purpleidea/mgmt
Cloning into 'mgmt'...
remote: Enumerating objects: 624, done.
remote: Counting objects: 100% (624/624), done.
remote: Compressing objects: 100% (464/464), done.
remote: Total 11259 (delta 288), reused 279 (delta 138), pack-reused 10635
Receiving objects: 100% (11259/11259), 4.91 MiB | 4.50 MiB/s, done.
Resolving deltas: 100% (7581/7581), done.
Checking connectivity... done.
Submodule 'vendor/github.com/purpleidea/distribution' (https://github.com/purpleidea/distribution) registered for path 'vendor/github.com/docker/distribution'
mount "/mnt/acceptance_mount" {
state => "exists",
device => "/tmp/loopdevice",
type => "ext2",
options => {
"rw"=>"",
"loop"=>"",
},
}
demo@dev-app01-ffrank:~/go/src/github.com/purpleidea/mgmt$ sudo mgmt run --tmp-prefix --converged-timeout 5 yaml --yaml mount_test_simple.yml
This is: mgmt, version: 0.0.18-50-gc694fde-dirty
Copyright (C) 2013-2019+ James Shubin and the project contributors
Written by James Shubin <james@shubin.ca> and the project contributors
01:07:55 hello.go:53: main: start: 1558998475568555256
01:07:55 main.go:191: main: warning: working prefix directory is temporary!
01:07:55 main.go:191: main: working prefix is: /tmp/mgmt-dev-app01-ffrank-044599394
01:07:56 pgp.go:89: PGP: Created key: BA88AEBA
01:07:56 main.go:191: main: etcd: seeds: no seeds specified!
01:07:56 etcd.go:446: Etcd: Bootstrapping...
389 native translations
320 failed translations
226 unsupported resources
226x User[...] the managehome parameter is not supported
226x User[...] cannot be translated natively, falling back to 'exec puppet resource'
208x Ssh_authorized_key[...] cannot be translated natively, falling back to 'exec puppet resource'
78x User[...] cannot translate attribute 'shell', failing resource translation
78x User[...] cannot translate attribute 'groups', failing resource translation
41x Exec[...] cannot translate attribute 'path', failing resource translation
41x Exec[...] cannot be translated natively, falling back to 'exec puppet resource'
$ ./mgmt run --client-urls http://86.231.179.14:2379 --server-urls http://86.231.179.14:2380 --advertise-client-urls http://86.231.179.14:2379 --advertise-server-urls http://86.231.179.14:2380 --hostname h1 --ideal-cluster-size 1 --tmp-prefix --no-pgp lang --lang examples/lang/exchange0.mcl
2019-03-23 21:00:07.434141 I | cli: lang: lexing/parsing...
2019-03-23 21:00:07.443839 I | cli: lang: init...
2019-03-23 21:00:07.443925 I | cli: lang: interpolating...
2019-03-23 21:00:07.444012 I | cli: lang: building scope...
2019-03-23 21:00:07.444084 I | cli: lang: running type unification...
2019-03-23 21:00:07.444518 I | cli: lang: input: examples/lang/exchange0.mcl
2019-03-23 21:00:07.444566 I | cli: lang: tree:
.
├── exchange0.mcl
@ffrank
ffrank / console
Created December 12, 2018 02:35
go generate warnings from stringer
~/go/src/github.com/purpleidea/mgmt$ go generate ./...
stringer: checking package: augeas.go:27:2: could not import github.com/purpleidea/mgmt/engine (reading export data: /home/demo/go/pkg/linux_amd64/github.com/purpleidea/mgmt/engine.a: invalid encoding format in export data: got 'v'; want 'c' or 'd')
engine/resources/aws_ec2.go:110: running "stringer": exit status 1
stringer: checking package: type.go:25:11: could not import github.com/hashicorp/go-multierror (reading export data: /home/demo/go/pkg/linux_amd64/github.com/hashicorp/go-multierror.a: invalid encoding format in export data: got 'v'; want 'c' or 'd')
lang/types/type.go:37: running "stringer": exit status 1
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
ok: [localhost] => {
"changed": false,
"floating_ip": {
"attached": true,
"fixed_ip_address": "192.168.1.18",
"floating_ip_address": "10.96.214.57",
"floating_network_id": "c44fdb62-8071-44b7-8e9e-c470ba8e30d4",
"id": "54c20d20-8193-414b-835e-ff483449ee98",
"network": "c44fdb62-8071-44b7-8e9e-c470ba8e30d4",
"port_id": "8aad20ab-c7ac-4a45-8916-9c742d3d3784",