Skip to content

Commit

Permalink
Create redborder user and key in cloud mode
Browse files Browse the repository at this point in the history
  • Loading branch information
manegron committed Jan 15, 2025
1 parent 1f5accb commit 4879977
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,33 +160,33 @@
ssh_secrets = {}
end

unless node['redborder']['cloud']
# ssh user for webui execute commands on
execute 'create_user_redBorder' do
command 'sudo useradd -m -s /bin/bash redborder'
not_if 'getent passwd redborder'
end

directory '/home/redborder/.ssh' do
# ssh user for webui execute commands on
execute 'create_user_redBorder' do
command 'sudo useradd -m -s /bin/bash redborder'
not_if 'getent passwd redborder'
end

directory '/home/redborder/.ssh' do
owner 'redborder'
group 'redborder'
mode '0755'
action :create
end

unless ssh_secrets.empty? || ssh_secrets['public_rsa'].nil?
template '/home/redborder/.ssh/authorized_keys' do
source 'rsa.pub.erb'
owner 'redborder'
group 'redborder'
mode '0755'
mode '0600'
variables(
public_rsa: ssh_secrets['public_rsa']
)
action :create
end

unless ssh_secrets.empty? || ssh_secrets['public_rsa'].nil?
template '/home/redborder/.ssh/authorized_keys' do
source 'rsa.pub.erb'
owner 'redborder'
group 'redborder'
mode '0600'
variables(
public_rsa: ssh_secrets['public_rsa']
)
action :create
end
end
end

# template "/opt/rb/etc/sysconfig/iptables" do
# source "iptables.erb"
# owner "root"
Expand Down

0 comments on commit 4879977

Please sign in to comment.