spec/lib/.ansible.rb
# create an Ansible inventory hosts file
create an Ansible inventory hosts file
create an Ansible inventory hosts file
def ansible_hosts_add
    unless File.exists?(@ansible_host_file)
      begin
        f = File.open(@ansible_host_file)
        f.puts "#{@env_name} ansible_connection=ssh ansible_ssh_host=#{@ssh_host} ansible_ssh_user=#{@ssh_user} ansible_ssh_port=#{@ansible_ssh_port} ansible_ssh_private_key_file=#{@ssh_keys}"
      rescue
        raise "Failed to write Ansible inventory data at #{@ansible_host_file}"
      ensure
        File.close(f)
      end
    end
  end
def ansible_hosts_add unless File . exists? ( @ansible_host_file ) begin f = File . open ( @ansible_host_file ) f . puts "#{@env_name} ansible_connection=ssh ansible_ssh_host=#{@ssh_host} ansible_ssh_user=#{@ssh_user} ansible_ssh_port=#{@ansible_ssh_port} ansible_ssh_private_key_file=#{@ssh_keys}" rescue raise "Failed to write Ansible inventory data at #{@ansible_host_file}" ensure File . close ( f ) end end end
create an Ansible inventory hosts file
create an Ansible inventory hosts file