diff options
| -rwxr-xr-x | bin/debug.sh | 25 | ||||
| -rw-r--r-- | lib/leap_cli/commands/debug.rb | 15 | ||||
| -rw-r--r-- | puppet/modules/site_apt/manifests/dist_upgrade.pp | 10 | ||||
| -rw-r--r-- | puppet/modules/site_openvpn/manifests/server_config.pp | 6 | 
4 files changed, 50 insertions, 6 deletions
| diff --git a/bin/debug.sh b/bin/debug.sh new file mode 100755 index 00000000..2363644c --- /dev/null +++ b/bin/debug.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# debug script to be run on remote servers +# called from leap_cli with the 'leap debug' cmd + +regexp='(leap|pixelated|stunnel|couch|soledad|haproxy)' + +# query facts and filter out private stuff +echo -e '\n\n' +facter | egrep -iv '(^ssh|^uniqueid)' + +# query installed versions +echo -e '\n\n' +dpkg -l | egrep "$regexp" + + +# query running procs +echo -e '\n\n' +ps aux|egrep "$regexp" + +echo -e '\n\n' +echo -e "Last deploy:\n" +tail -2 /var/log/leap/deploy-summary.log + + + diff --git a/lib/leap_cli/commands/debug.rb b/lib/leap_cli/commands/debug.rb new file mode 100644 index 00000000..a969b752 --- /dev/null +++ b/lib/leap_cli/commands/debug.rb @@ -0,0 +1,15 @@ +module LeapCli; module Commands + +  desc 'Output debug information.' +  long_desc 'The FILTER can be the name of a node, service, or tag.' +  arg_name 'FILTER' +  command [:debug, :d] do |c| +    c.action do |global,options,args| +      nodes = manager.filter!(args) +      ssh_connect(nodes, connect_options(options)) do |ssh| +        ssh.leap.debug +      end +    end +  end + +end; end diff --git a/puppet/modules/site_apt/manifests/dist_upgrade.pp b/puppet/modules/site_apt/manifests/dist_upgrade.pp index 08de31bb..40e2dd58 100644 --- a/puppet/modules/site_apt/manifests/dist_upgrade.pp +++ b/puppet/modules/site_apt/manifests/dist_upgrade.pp @@ -1,17 +1,17 @@ +# upgrade all packages  class site_apt::dist_upgrade { +  # facter returns 'true' as string +  # lint:ignore:quoted_booleans    if $::apt_running == 'true' { +  # lint:endignore      fail ('apt-get is running in background - Please wait until it finishes. Exiting.')    } else { -    exec{'initial_apt_update': -      command     => '/usr/bin/apt-get update', -      refreshonly => false, -      timeout     => 360, -    }      exec{'initial_apt_dist_upgrade':        command     => "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold'  dist-upgrade",        refreshonly => false,        timeout     => 1200, +      require     => Exec['refresh_apt']      }    }  } diff --git a/puppet/modules/site_openvpn/manifests/server_config.pp b/puppet/modules/site_openvpn/manifests/server_config.pp index d7f6f9eb..ca9926cc 100644 --- a/puppet/modules/site_openvpn/manifests/server_config.pp +++ b/puppet/modules/site_openvpn/manifests/server_config.pp @@ -213,7 +213,11 @@ define site_openvpn::server_config(        exec { "enable_systemd_${openvpn_configname}":          refreshonly => true,          command     => "/bin/systemctl enable openvpn@${openvpn_configname}", -        subscribe   => File["/etc/openvpn/${openvpn_configname}.conf"]; +        subscribe   => File["/etc/openvpn/${openvpn_configname}.conf"], +        notify      => Service["openvpn@${openvpn_configname}"]; +      } +      service { "openvpn@${openvpn_configname}": +        ensure  => running        }      }    } | 
