Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth_map: cant create options #140

Open
genaumann opened this issue Nov 15, 2018 · 1 comment
Open

auth_map: cant create options #140

genaumann opened this issue Nov 15, 2018 · 1 comment
Assignees

Comments

@genaumann
Copy link

Hello, I wanted to add some keys to my authorized_keys.

I need some options, like from="8.8.8.8" and command="uptime". I tried to create this entries with the auth_map state of this formula.

First problem

pillar file

openssh:
  ...
  auth_map:
    ssh_to_host:
      source: salt://ssh/keys
      users:
        user1:
          first-key:
            options:
              from=8.8.8.8
          second-key:
            options:
              command=uptime
...

I get the following result:

f,r,o,m,=,8,.,8,.,8,.,8 ssh-rsa ...

Second problem

In the authorized key file, values like IP-addresses need quotes, otherwise I get an error. How can I handle this problem?

openssh:
  ...
  auth_map:
    ssh_to_host:
      source: salt://ssh/keys
      users:
        user1:
          first-key:
            options:
              - from='8.8.8.8'
              - command='uptime'
...

I get the following error:

 Data failed to compile:
----------
    Rendering SLS 'base:openssh.auth_map' failed: while parsing a block mapping
  in "<unicode string>", line 60, column 7:
        - options: "["from='8.8.8.8'", "co ...
          ^
expected <block end>, but found '<scalar>'
  in "<unicode string>", line 60, column 19:
        - options: "["from='8.8.8.8'", "command='uptime'"]"

Please help me to answer my problems.

@alxwr
Copy link
Member

alxwr commented Nov 28, 2018

@r-pufky Thanks for your detailed report. I'll try to have a look next week. (Sry, I'm just to busy now.)

@alxwr alxwr pinned this issue Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants