RunDeck: Difference between revisions

From SWKLS WIKI
Jump to navigation Jump to search
(Created page with "==Rundeck Installation== * source: https://thedataguy.in/rundeck-install-configure-centos-with-mysql/ * source: https://www.techrepublic.com/article/how-to-add-remote-nodes-t...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 10: Line 10:
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
java -jar /var/lib/rundeck/bootstrap/rundeck-3.1.2-20190927.war --encryptpwd Jetty
java -jar /var/lib/rundeck/bootstrap/rundeck-3.1.2-20190927.war --encryptpwd Jetty
 
</syntaxhighlight>
# Built in encryption provided by Rundeck, default jetty returning a MD5 hash
(Built in encryption provided by Rundeck, default jetty returning a MD5 hash)
Enter values for
Enter values for
<code>
  user:
user:
  <Enter>
<Enter>
  password:
password:
  <yourpassword>
<yourpassword>
</code>


In PuTTY left-click and hold to select the md5 output, with that selected go into the text editor of your choice like Notepad++ and paste
In PuTTY left-click and hold to select the md5 output, with that selected go into the text editor of your choice like Notepad++ and paste


ex. MD5:a98c74fe257719c0d0498cf68a7c6ee4
  ex. MD5:a98c74fe257719c0d0498cf68a7c68e4


then edit the realm.properties file
then edit the realm.properties file
Line 28: Line 26:
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
sudo vim /etc/rundeck/realm.properties
sudo vim /etc/rundeck/realm.properties
</syntxhighlight>
</syntaxhighlight>


navigate down to the users (ex.): admin:admin,user,admin,architect,deploy,build
* Navigate down to the users (ex.): admin:admin,user,admin,architect,deploy,build
* Press i to be able to insert text, and enter your username followed the md5 hash in a new entry:
* Right-Click in PuTTY to paste


Press i to be able to insert text, and enter your username followed the md5 hash in a new entry:
  <username>: MD5:a98c74fe257719c0d0498cf68a7c68e4,user,admin


Right-Click in PuTTY to paste
To exit the vim editor, press the ESC key, then type <code>:wq <enter></code>
 
<username>: MD5:a98c74fe257719c0d0498cf68a7c6ee4,user,admin
To exit the vim editor, press the ESC key, then type :wq <enter>


Finally restart the service for it to take effect
Finally restart the service for it to take effect
Line 71: Line 68:


insert:
insert:
<syntaxhighlight line start="1">
<syntaxhighlight lang="bash" line start="1">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
&lt;project>
&lt;project>

Latest revision as of 14:21, 26 March 2020

Rundeck Installation

Rundeck User Creation

Log in to the rundeck server.

java -jar /var/lib/rundeck/bootstrap/rundeck-3.1.2-20190927.war --encryptpwd Jetty

(Built in encryption provided by Rundeck, default jetty returning a MD5 hash) Enter values for

  user:
  <Enter>
  password:
  <yourpassword>

In PuTTY left-click and hold to select the md5 output, with that selected go into the text editor of your choice like Notepad++ and paste

  ex. MD5:a98c74fe257719c0d0498cf68a7c68e4

then edit the realm.properties file

sudo vim /etc/rundeck/realm.properties
  • Navigate down to the users (ex.): admin:admin,user,admin,architect,deploy,build
  • Press i to be able to insert text, and enter your username followed the md5 hash in a new entry:
  • Right-Click in PuTTY to paste
  <username>: MD5:a98c74fe257719c0d0498cf68a7c68e4,user,admin

To exit the vim editor, press the ESC key, then type :wq <enter>

Finally restart the service for it to take effect

sudo systemctl restart rundeckd

Rundeck Project & Nodes Setup

Create Project in GUI Navigate to Project Settings -> Edit Configuration (bottom left) Select 'Edit Configuration File' in GUI (top right corner) Add to bottom:

resources.source.1.config.file=/var/lib/rundeck/projects/<MyProjectName>/etc/resources.xml
resources.source.1.config.generateFileAutomatically=true
resources.source.1.config.includeServerNode=false
resources.source.1.type=file
resources.source.1.config.writeable=true

Create directories under /var/lib/rundeck/projects:

sudo mkdir /var/lib/rundeck/projects/<myprojectname>
sudo mkdir /var/lib/rundeck/projects/<myprojectname>/etc
sudo chown -R rundeck:rundeck /var/lib/projects/<myprojectname>

Create resources.xml file:

sudo vi /var/lib/rundeck/projects/&lt;myprojectname>/etc/resources.xml

insert:

<?xml version="1.0" encoding="UTF-8"?>
&lt;project>
  <node name="TheNodeName" tags="SomeTag" hostname="<ip address or DNS name>" osName="OSName" username="rundeck"/>
&lt;/project>

Change ownership of new resources.xml:

sudo chown -R rundeck:rundeck /var/lib/rundeck/projects/<myprojectname>/etc/resources.xml

Nodes should now appear in GUI

Sources:

  1. https://thedataguy.in/add-nodes-to-the-rundeck/
  2. https://stackoverflow.com/questions/54448600/adding-a-remote-node-in-rundeck-3
  3. https://geekdudes.wordpress.com/2018/02/06/installing-and-configuring-rundeck-on-centos-7/

Rundeck Key Storage

When using a different user / ssh private key than the default 'rundeck' user.

  • Navigate to Key Storage via top right menu (gear)
  • Click 'Add or Upload Key'
  • Select values (key type, upload file, name, etc.)
  • Save the new key
  • Navigate to project configuration edit in GUI
  • Navigate to 'Default Node Executor'
  • Select path / new key for the project
  • Remove default key entry (project.ssh-keypath=/var/lib/rundeck/.ssh/id_rsa)