Package build with Saltstack
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm attempting to get a specific package pulled from Github and installed with Salt (in a masterless configuration) when provisioning a machine. So far, I've managed to do so like this:
{% set pkg = {
'Ubuntu': 'https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb',
}.get(grains.os) %}
curl -O -L {{ pkg }}:
cmd.run
dpkg -i some-pakage-v1-unknown-linux-gnu.deb:
cmd.run
Now, Salt does have a module that seems to do this exact thing, it's called pkgbuild.built. I tried using it but without much success. This is what I've right at the moment:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
And I'm getting this error:
ID: some-pakage-v1
Function: pkgbuild.built
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1913, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1898, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pkgbuild.py", line 207, in built
ret['changes'] = __salt__[func](
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1155, in __getitem__
func = super(LazyLoader, self).__getitem__(item)
File "/usr/lib/python2.7/dist-packages/salt/utils/lazy.py", line 104, in __getitem__
raise KeyError(key)
KeyError: 'pkgbuild.build'
Started: 18:29:57.051892
Duration: 9.644 ms
Changes:
github salt-stack
add a comment |
I'm attempting to get a specific package pulled from Github and installed with Salt (in a masterless configuration) when provisioning a machine. So far, I've managed to do so like this:
{% set pkg = {
'Ubuntu': 'https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb',
}.get(grains.os) %}
curl -O -L {{ pkg }}:
cmd.run
dpkg -i some-pakage-v1-unknown-linux-gnu.deb:
cmd.run
Now, Salt does have a module that seems to do this exact thing, it's called pkgbuild.built. I tried using it but without much success. This is what I've right at the moment:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
And I'm getting this error:
ID: some-pakage-v1
Function: pkgbuild.built
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1913, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1898, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pkgbuild.py", line 207, in built
ret['changes'] = __salt__[func](
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1155, in __getitem__
func = super(LazyLoader, self).__getitem__(item)
File "/usr/lib/python2.7/dist-packages/salt/utils/lazy.py", line 104, in __getitem__
raise KeyError(key)
KeyError: 'pkgbuild.build'
Started: 18:29:57.051892
Duration: 9.644 ms
Changes:
github salt-stack
add a comment |
I'm attempting to get a specific package pulled from Github and installed with Salt (in a masterless configuration) when provisioning a machine. So far, I've managed to do so like this:
{% set pkg = {
'Ubuntu': 'https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb',
}.get(grains.os) %}
curl -O -L {{ pkg }}:
cmd.run
dpkg -i some-pakage-v1-unknown-linux-gnu.deb:
cmd.run
Now, Salt does have a module that seems to do this exact thing, it's called pkgbuild.built. I tried using it but without much success. This is what I've right at the moment:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
And I'm getting this error:
ID: some-pakage-v1
Function: pkgbuild.built
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1913, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1898, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pkgbuild.py", line 207, in built
ret['changes'] = __salt__[func](
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1155, in __getitem__
func = super(LazyLoader, self).__getitem__(item)
File "/usr/lib/python2.7/dist-packages/salt/utils/lazy.py", line 104, in __getitem__
raise KeyError(key)
KeyError: 'pkgbuild.build'
Started: 18:29:57.051892
Duration: 9.644 ms
Changes:
github salt-stack
I'm attempting to get a specific package pulled from Github and installed with Salt (in a masterless configuration) when provisioning a machine. So far, I've managed to do so like this:
{% set pkg = {
'Ubuntu': 'https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb',
}.get(grains.os) %}
curl -O -L {{ pkg }}:
cmd.run
dpkg -i some-pakage-v1-unknown-linux-gnu.deb:
cmd.run
Now, Salt does have a module that seems to do this exact thing, it's called pkgbuild.built. I tried using it but without much success. This is what I've right at the moment:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
And I'm getting this error:
ID: some-pakage-v1
Function: pkgbuild.built
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1913, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1898, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pkgbuild.py", line 207, in built
ret['changes'] = __salt__[func](
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1155, in __getitem__
func = super(LazyLoader, self).__getitem__(item)
File "/usr/lib/python2.7/dist-packages/salt/utils/lazy.py", line 104, in __getitem__
raise KeyError(key)
KeyError: 'pkgbuild.build'
Started: 18:29:57.051892
Duration: 9.644 ms
Changes:
github salt-stack
github salt-stack
edited Nov 17 '18 at 0:09
pierreb
asked Nov 16 '18 at 18:34
pierrebpierreb
62011025
62011025
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Could it be that you made a mistake in the indentation?
According to the documentation, I would expect this:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
The line after results has to be indented
Still, in your case, if you want to install the .deb file, why not the pkg.installed rules?
some-package-v1:
pkg.installed:
- sources:
- some-package-v1: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me anInvalidly formatted 'sources' parametererror (edited your answer accordingly).
– pierreb
Nov 19 '18 at 1:15
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343546%2fpackage-build-with-saltstack%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Could it be that you made a mistake in the indentation?
According to the documentation, I would expect this:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
The line after results has to be indented
Still, in your case, if you want to install the .deb file, why not the pkg.installed rules?
some-package-v1:
pkg.installed:
- sources:
- some-package-v1: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me anInvalidly formatted 'sources' parametererror (edited your answer accordingly).
– pierreb
Nov 19 '18 at 1:15
add a comment |
Could it be that you made a mistake in the indentation?
According to the documentation, I would expect this:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
The line after results has to be indented
Still, in your case, if you want to install the .deb file, why not the pkg.installed rules?
some-package-v1:
pkg.installed:
- sources:
- some-package-v1: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me anInvalidly formatted 'sources' parametererror (edited your answer accordingly).
– pierreb
Nov 19 '18 at 1:15
add a comment |
Could it be that you made a mistake in the indentation?
According to the documentation, I would expect this:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
The line after results has to be indented
Still, in your case, if you want to install the .deb file, why not the pkg.installed rules?
some-package-v1:
pkg.installed:
- sources:
- some-package-v1: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
Could it be that you made a mistake in the indentation?
According to the documentation, I would expect this:
some-pakage-v1:
pkgbuild.built:
- runas: root
- results:
- some-package-v1-unknown-linux-gnu.deb
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/some-package.spec
- tgt: ubuntu-18.04.1-x86_64
- sources:
- {{ pkg }}
The line after results has to be indented
Still, in your case, if you want to install the .deb file, why not the pkg.installed rules?
some-package-v1:
pkg.installed:
- sources:
- some-package-v1: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
edited Nov 19 '18 at 14:09
pierreb
62011025
62011025
answered Nov 18 '18 at 0:58
agm650agm650
264
264
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me anInvalidly formatted 'sources' parametererror (edited your answer accordingly).
– pierreb
Nov 19 '18 at 1:15
add a comment |
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me anInvalidly formatted 'sources' parametererror (edited your answer accordingly).
– pierreb
Nov 19 '18 at 1:15
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me an
Invalidly formatted 'sources' parameter error (edited your answer accordingly).– pierreb
Nov 19 '18 at 1:15
Thank you for pointing out the indentation. It is in fact correct in my original file and I seem to have messed the formatting when copy-pasting it into my question though. As to the sources parameter, it is the right solution. I remember going through the documentation for the pkg.installed state but didn't find a reference to it. Thanks for the hint! I just had to adjust the format of the parameter as it was giving me an
Invalidly formatted 'sources' parameter error (edited your answer accordingly).– pierreb
Nov 19 '18 at 1:15
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343546%2fpackage-build-with-saltstack%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown