Package build with Saltstack
up vote
0
down vote
favorite
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 |
up vote
0
down vote
favorite
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 |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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 2 days ago
asked 2 days ago
pierreb
5281623
5281623
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
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: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
7 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
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: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
7 hours ago
add a comment |
up vote
1
down vote
accepted
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: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
7 hours ago
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
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: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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: https://github.com/some-package/releases/download/v1/some-package-v1-unknown-linux-gnu.deb
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 19 hours ago
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered yesterday
agm650
262
262
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
agm650 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
7 hours ago
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
7 hours ago
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
7 hours ago
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
7 hours ago
add a comment |
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