diff options
author | varac <varacanero@zeromail.org> | 2013-07-15 11:37:40 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2013-07-15 11:37:40 +0200 |
commit | 99952fbf6c03e324e1a85dcdf9426850fe7610b6 (patch) | |
tree | 0a729bc656ad6c0ab2e23b825cc73be03e0a8a7a /lib/leap_cli/commands | |
parent | 93e5eb7eeb11c5d07b26db6c62feb1a3471aa41b (diff) | |
parent | eec3e1760cec10cdd508771ddb71efeff04cfff8 (diff) |
Merge branch 'master' of ssh://code.leap.se/leap_cli
Diffstat (limited to 'lib/leap_cli/commands')
-rw-r--r-- | lib/leap_cli/commands/ca.rb | 8 | ||||
-rw-r--r-- | lib/leap_cli/commands/deploy.rb | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/leap_cli/commands/ca.rb b/lib/leap_cli/commands/ca.rb index da5bee9..b5a8765 100644 --- a/lib/leap_cli/commands/ca.rb +++ b/lib/leap_cli/commands/ca.rb @@ -36,11 +36,11 @@ module LeapCli; module Commands nodes = manager.filter!(args) nodes.each_node do |node| - if options[:force] || cert_needs_updating?(node) - generate_cert_for_node(node) - elsif !node.x509.use + if !node.x509.use remove_file!([:node_x509_key, node.name]) remove_file!([:node_x509_cert, node.name]) + elsif options[:force] || cert_needs_updating?(node) + generate_cert_for_node(node) end end end @@ -203,7 +203,7 @@ module LeapCli; module Commands dns_names << $1 if value =~ /^DNS:(.*)$/ end if ips.first != node.ip_address - log :updating, "cert for node '#{node.name}' because ip_address has changed (from #{ips} to #{node.ip_address})" + log :updating, "cert for node '#{node.name}' because ip_address has changed (from #{ips.first} to #{node.ip_address})" return true elsif dns_names != dns_names_for_node(node) log :updating, "cert for node '#{node.name}' because domain name aliases have changed (from #{dns_names.inspect} to #{dns_names_for_node(node).inspect})" diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb index 8130111..239af2a 100644 --- a/lib/leap_cli/commands/deploy.rb +++ b/lib/leap_cli/commands/deploy.rb @@ -63,7 +63,11 @@ module LeapCli node = manager.node(server.host) hiera_file = Path.relative_path([:hiera, node.name]) ssh.leap.log hiera_file + ' -> ' + node.name + ':' + dest_dir + '/hiera.yaml' - {:source => hiera_file, :dest => dest_dir + '/hiera.yaml'} + { + :source => hiera_file, + :dest => dest_dir + '/hiera.yaml', + :flags => "-rltp --chmod=u+rX,go-rwx" + } end end @@ -80,7 +84,7 @@ module LeapCli :dest => dest_dir, :excludes => "*", :includes => calculate_includes_from_files(files_to_sync), - :flags => "--relative --dirs --delete --delete-excluded --filter='protect hiera.yaml' --copy-links" + :flags => "-ltp --chmod=u+rX,go-rwx --relative --dirs --delete --delete-excluded --filter='protect hiera.yaml' --copy-links" } else nil @@ -97,7 +101,7 @@ module LeapCli :chdir => Path.platform, :excludes => '*', :includes => ['/bin', '/bin/**', '/puppet', '/puppet/**'], - :flags => "--relative --dirs --delete --copy-links" + :flags => "-rlt --relative --delete --copy-links" } end end |