-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Modify Outerloop job in groovy to run on Ubuntu and Windows. #6028
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [kdcdefaults] | ||
| kdc_ports = 750,88 | ||
|
|
||
| [realms] | ||
| TEST.COREFX.NET = { | ||
| database_name = /var/lib/krb5kdc/principal | ||
| admin_keytab = FILE:/etc/krb5kdc/kadm5.keytab | ||
| acl_file = /etc/krb5kdc/kadm5.acl | ||
| key_stash_file = /etc/krb5kdc/stash | ||
| kdc_ports = 750,88 | ||
| max_life = 10h 0m 0s | ||
| max_renewable_life = 7d 0h 0m 0s | ||
| master_key_type = des3-hmac-sha1 | ||
| supported_enctypes = aes256-cts:normal arcfour-hmac:normal des3-hmac-sha1:normal des-cbc-crc:normal des:normal des:v4 des:norealm des:onlyrealm des:afs3 | ||
| default_principal_flags = +preauth | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [libdefaults] | ||
| default_realm = TEST.COREFX.NET | ||
|
|
||
| [realms] | ||
| TEST.COREFX.NET = { | ||
| kdc = localhost | ||
| admin_server = localhost | ||
| default_domain = test.corefx.net | ||
| } | ||
|
|
||
| [domain_realm] | ||
| .test.corefx.net = TEST.COREFX.NET |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/bin/bash | ||
|
|
||
| OS=`cat /etc/os-release | grep "PRETTY_NAME" | sed 's/PRETTY_NAME=//g' | sed 's/["]//g' | awk '{print $1}'` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why parse PRETTY_NAME when you can just read ID from os-release?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rahulkotecha Can you please address the PR comments on networking scripts. Thanks!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure.. Rahul can take care of all these changes when he sends his PR with the updates required for other distros as well
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. took care of these changes and changes required for other Linux distros as part of: rahulkotecha-zz@e8acf95 |
||
|
|
||
| realm="TEST.COREFX.NET" | ||
|
|
||
| principal1="HOST/host.test.corefx.net" | ||
| principal2="HTTP" | ||
| krb_user="krb_user" | ||
| password="password" | ||
|
|
||
| kadmin="kadmin.local" | ||
| krb5kdc="krb5kdc" | ||
| kdb5_util="kdb5_util" | ||
| add_principal_cmd="add_principal -pw ${password}" | ||
|
|
||
| krb_conf="krb5.conf" | ||
| kdc_conf="kdc.conf" | ||
| keytabfile="/etc/krb5.keytab" | ||
|
|
||
| # TODO: These locations varies for different distros, Set the values conditianally | ||
| krb_conf_location="/etc/" | ||
| kdc_conf_location="/etc/krb5kdc/" | ||
| database_file="/var/lib/krb5kdc/principal*" | ||
|
|
||
| kdc_setup() | ||
| { | ||
| #Create/copy krb5.conf in /etc/ and kdc.conf in /etc/krb5kdc/ | ||
| echo "Copying krb5.conf and kdc.conf.." | ||
| sudo /bin/cp ${krb_conf} ${krb_conf_location} | ||
| sudo /bin/cp ${kdc_conf} ${kdc_conf_location} | ||
|
|
||
| echo "Creating KDC database for realm ${realm}.." | ||
| sudo ${kdb5_util} create -r ${realm} -P ${password} -s | ||
|
|
||
| echo "Adding principal ${principal1}.." | ||
| sudo ${kadmin} -q "${add_principal_cmd} ${principal1}@${realm}" | ||
|
|
||
| echo "Adding principal ${principal2}.." | ||
| sudo ${kadmin} -q "${add_principal_cmd} ${principal2}@${realm}" | ||
|
|
||
| echo "Adding user ${krb_user}.." | ||
| sudo ${kadmin} -q "${add_principal_cmd} ${krb_user}@${realm}" | ||
|
|
||
| echo "Exporting keytab for ${principal1}" | ||
| sudo ${kadmin} -q "ktadd ${principal1}@${realm}" | ||
|
|
||
| echo "Exporting keytab for ${principal2}" | ||
| sudo ${kadmin} -q "ktadd ${principal2}@${realm}" | ||
|
|
||
| echo "Exporting keytab for ${krb_user}" | ||
| sudo ${kadmin} -q "ktadd ${krb_user}@${realm}" | ||
| } | ||
|
|
||
| echo "Removing existing database" | ||
| sudo rm -rf ${database_file} | ||
|
|
||
| case ${OS} in | ||
| "Ubuntu") | ||
| dpkg -s krb5-kdc >/dev/null 2>&1 | ||
| if [ $? -ne 0 ] | ||
| then | ||
| echo "Installing krb5-kdc.." | ||
| sudo DEBIAN_FRONTEND=noninteractive apt-get -y install krb5-kdc krb5-admin-server | ||
| else | ||
| echo "krb5-kdc already installed.." | ||
| fi | ||
|
|
||
| echo "Stopping KDC.." | ||
| if pgrep krb5kdc 2> /dev/null; then killall krb5kdc ; fi | ||
| if pgrep kadmind 2> /dev/null; then killall kadmind ; fi | ||
|
|
||
| kdc_setup | ||
|
|
||
| echo "Starting KDC.." | ||
| sudo ${krb5kdc} | ||
|
|
||
| ;; | ||
|
|
||
| "Debian") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just echo ${OS} |
||
| echo "This is a Debian system" | ||
| ;; | ||
|
|
||
| "CentOS") | ||
| echo "This is a CentOS system" | ||
| ;; | ||
|
|
||
| "Red Hat") | ||
| echo "This is a RedHat system" | ||
| ;; | ||
|
|
||
| *) | ||
| echo "This is an Unknown system" | ||
| ;; | ||
| esac | ||
|
|
||
| sudo chmod +r ${keytabfile} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this used? Perhaps I missed it but I don't see it used in the script anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used anywhere currently, but will be used when all OSes are supported in Outerloop. Will remove the def Outerloop then. Sorry your comment didnt update on my client.. Saw this only now.