Monday, 19 June 2017

5 Easy Steps to Install Rundeck on CentOS

Rundeck is all about ....!


Well, Rundeck is open source software that helps you automate routine operational procedures in data center or cloud environments, it allows you to run tasks on any number of nodes from a web-based or command-line interface.

Rundeck also includes other features that make it easy to scale up your automation efforts including: access control, workflow building, scheduling, logging, and integration with external sources for node and option data. Refer introduction and essential-concepts URL for more details.

Pre-requirements and preparing the server to install rundeck:


The following operating systems are known to support Rundeck:

  • Linux: Most recent distributions are likely to work
  • Windows: XP, Server and above
  • Mac OS X 10.4 or later 
     
Root (or Administrator on Windows) is not required or recommended. We recommend using a dedicated user account such as "rundeck". If there is need for root access, please set up the Rundeck user to have access via sudo.

step1 - Install java:


java JDK must be installed. Install any JDK that is 1.7+.

# yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel -y

Add the below contents into file: /etc/profile.d/java.sh
#!/bin/bash
JAVA_HOME=/usr/bin/java
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

# source /etc/profile.d/java.sh


Install Rundeck on CentOS

step2 - Network access:

Add below line into file: /etc/sysconfig/iptables

-A INPUT -p tcp -m state --state NEW -m tcp --dport 4440 -j ACCEPT

# /etc/init.d/iptables restart

Step 3 - Installing with RPM...:


The latest install documentation is available at http://rundeck.org/downloads.html, To install it using yum, first install the yum repo package and then run yum install:


# yum install rundeck

# /etc/init.d/rundeckd start

Install Rundeck on CentOS

Install Rundeck on CentOS


Install Rundeck on CentOS

Post installation steps:

To make sure the service is running:

When the server starts, it binds to several TCP ports by default:

# /etc/init.d/rundeckd status

# netstat -anp | grep '4440\|4443'


Install Rundeck on CentOS


The default username and password is admin:admin, if you want to change the password for admin user then edit the file: /etc/rundeck/realm.properties

Install Rundeck on CentOS

 step 4 - Comment out the following line in file: /etc/rundeck/rundeck-config.properties

# Comment this out from:
grails.serverURL=http://localhost:4440

# To:
# grails.serverURL=http://localhost:4440

step 5 - Modify the below lines in file: /etc/rundeck/framework.properties(this might prevent the redirect to localhost issue after login).

framework.server.name = localhost
framework.server.hostname = localhost
framework.server.port = 4440
framework.server.url = http://localhost:4440

to

framework.server.name = <your-server-ip>
framework.server.hostname = <your-server-ip>
framework.server.port = 4440
framework.server.url = http://<your-server-ip>:4440

Install Rundeck on CentOS

Now, lets restart the service and try to login:

Install Rundeck on CentOS

Install Rundeck on CentOS


Install Rundeck on CentOS

Install Rundeck on CentOS

Thursday, 27 April 2017

Resolved: DOCKER: Error response from daemon: Could not attach to network / rpc error: code = 7 desc = network not manually attachable.

I got this error: 'docker: Error response from daemon: Could not attach to network <nw-name>: rpc error: code = 7 desc = network <nw-name> not manually attachable.' when i try to create the container on the overlay network on swarm mode enabled,





In docker 1.12 with swarm mode enabled, "Swarm" scoped networks (see the "SCOPE" column) cannot be used for docker run, only for services and now it has been rectified.

I'm using updated version of docker, but still why i'm experiencing the error ?






because the network just created but not manually attachable. To fix the issue we gonna use --attachable flag while creating network.

[ --attachable             Enable manual container attachment ]






(Need to create service on the overlay network, so that the overlay network will available / list on the worker node)



docker inspect attnw (attnw is our test network)should show your own container names on the overlay network across the nodes (manager / worker) and must reachable.

Wednesday, 25 May 2016

SALT-SSH: AttributeError: 'module' object has no attribute 'fromstringlist'

This error triggers when the salt-master is CentOS6 and the target is CentOS7. 
The salt-master on CentOS6 would copy ElementTree.py to the minion on CentOS7 but 
python2.6's lib cannot run directly on python2.7.

To overcome this issue,

On the salt-master:

1). Find the thin.py

# find / -name thin.py
/usr/lib/python2.6/site-packages/salt/runners/thin.py
/usr/lib/python2.6/site-packages/salt/utils/thin.py

In /usr/lib/python2.6/site-packages/salt/utils/thin.py

try:
    import xml
    HAS_XML = True
except ImportError:
    HAS_XML = False

Modify as:

try:
    import xml
    HAS_XML = False
except ImportError:
    HAS_XML = False


2). remove the thin.tgz from cache

# rm /var/cache/salt/master/thin/thin.tgz

3). Perform the salt-ssh command again with -W
( -W for Select a random temp dir to deploy on the remote system. The dir will be cleaned
after the execution.)

# salt-ssh -W rnd test.ping

# salt-ssh -W rnd disk.usage