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

Add Consul's autocompletion for shell #407

Open
jardleex opened this issue Feb 7, 2018 · 5 comments
Open

Add Consul's autocompletion for shell #407

jardleex opened this issue Feb 7, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@jardleex
Copy link
Contributor

jardleex commented Feb 7, 2018

Hi,

I just stumbled over the fact that Consul supports autocompletion.
It would be nice if this module would support that.

Issuing the command documented with a Puppet exec ain't worked for us as it seem to require a interactive shell. To bypass this we solved it this way:

      file_line { 'enabe_consul_autocompletion':
        path  => '/root/.bashrc',
        line  => 'complete -C /usr/local/bin/consul consul',
        match => '^complete -C /usr/local/bin/consul consul$',
      }

As we're still running with Puppet 3 I can't test this with Puppet 4 (which is a req for the latest version of this module).
Would be great if somebody with a recent Puppet setup can provide a PR.

Thanks and regards

jardleex

@lesinigo
Copy link

lesinigo commented Feb 7, 2018

IMHO it would be better to drop a file { '/etc/bash_completion.d/consul': } rather than mess with root's .bashrc

@jardleex
Copy link
Contributor Author

jardleex commented Feb 7, 2018

Sound's even better. Just tested this one successful:

      file { '/etc/bash_completion.d/consul':
        ensure  => file,
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        content => "complete -C /usr/local/bin/consul consul\n"
      }

@solarkennedy
Copy link
Contributor

Sounds good. I think it needs to be carefully deployed to linux-only installs first. (maybe someone from osx / windows platforms could say what the correct path is there. I think the "install" class is as good as any of a place to put this.

@solarkennedy solarkennedy added the enhancement New feature or request label Sep 28, 2019
@stale
Copy link

stale bot commented Sep 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@jardleex
Copy link
Contributor Author

Just created the missing request. I'm open for any improvement request I can realize.

@stale stale bot removed the wontfix label Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants