Skip to content

Commit 90b2115

Browse files
committed
added bash_completion_compat_dir
1 parent 0a9b4a7 commit 90b2115

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# @param arch Architecture of consul binary to download
1313
# @param archive_path Path used when installing consul via the url
1414
# @param bash_completion Whether to setup bash completion. Adjust bin_dir when install_method == package.
15+
# @param bash_completion_compat_dir Directory to place bash-completion file for Consul into.
1516
# @param bin_dir Directory to create the symlink to the consul binary in.
1617
# @param binary_group The group that the file belongs to.
1718
# @param binary_mode Permissions mode for the file.
@@ -97,6 +98,7 @@
9798
String[1] $arch = $consul::params::arch,
9899
Optional[Stdlib::Absolutepath] $archive_path = undef,
99100
Boolean $bash_completion = $consul::params::bash_completion,
101+
String[1] $bash_completion_compat_dir = $consul::params::bash_completion_compat_dir,
100102
Stdlib::Absolutepath $bin_dir = $consul::params::bin_dir,
101103
Optional[String[1]] $binary_group = $consul::params::binary_group,
102104
String[1] $binary_mode = $consul::params::binary_mode,

manifests/install.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@
121121
}
122122

123123
if ($consul::bash_completion) and ($consul::install_method != 'docker' ) {
124-
file { '/etc/bash_completion.d/consul':
124+
125+
file { $consul::bash_completion_compat_dir:
126+
ensure => 'directory',
127+
}
128+
129+
file { "${consul::bash_completion_compat_dir}/consul":
125130
ensure => file,
126131
owner => 'root',
127132
group => 'root',

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
default: {
4848
# 0 instead of root because OS X uses "wheel".
4949
$data_dir_mode = '0755'
50+
$bash_completion_compat_dir = '/etc/bash_completion.d/'
5051
$binary_group = '0'
5152
$binary_mode = '0555'
5253
$binary_name = 'consul'

0 commit comments

Comments
 (0)