![Security Automation with Ansible 2](https://wfqqreader-1252317822.image.myqcloud.com/cover/409/36700409/b_36700409.jpg)
Setting up Rundeck
The following Ansible playbook will set up Rundeck on the Ubuntu 16.04 OS. It also adds the Rundeck service to start up the process:
- name: installing rundeck on ubuntu 16.04 hosts: "192.168.1.7" remote_user: ubuntu gather_facts: False become: True tasks: - name: installing python2 minimal raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) - name: java and curl installation apt:
name: "{{ item }}"
state: present
update_cache: yes with_items: - curl - openjdk-8-jdk - name: downloading and installing rundeck deb package apt: deb: "http://dl.bintray.com/rundeck/rundeck-deb/rundeck-2.8.4-1-GA.deb" - name: add to startup and start rundeck service: name: rundeckd state: started
To set up Rundeck, run the following command. Where 192.168.1.7 is the server IP address where Rundeck will install:
ansible-playbook -i '192.168.1.7,' site.yml --ask-sudo-pass
Once it is successfully executed, navigate the browser to http://192.168.1.7:4440 and you can see the login panel for the Rundeck application. The default username and password to log in to Rundeck is admin:
![](https://epubservercos.yuewen.com/9966E6/19470400008918606/epubprivate/OEBPS/Images/Chapter_156.jpg?sign=1739144356-qvqaIQk9RGHZdte8CJjzoWBD31gCBHSv-0-eeef98173c9e34fab2fe638c2327de02)
Now we can create a new project to start working on. Provide a new Project Name and go with the default settings for now:
![](https://epubservercos.yuewen.com/9966E6/19470400008918606/epubprivate/OEBPS/Images/Chapter_9.jpg?sign=1739144356-RLJ65bTC4LC7prNktZ2vht7M1izZhRJv-0-2c019417062bf17b5247cef5acc88ed2)
Now, we can add multiple hosts into Rundeck to perform multiple actions. The following screenshot shows an example of running the uname -a command across multiple nodes, which matches osArch: amd64, we can also create filters for different use cases:
![](https://epubservercos.yuewen.com/9966E6/19470400008918606/epubprivate/OEBPS/Images/Chapter_41.jpg?sign=1739144356-hUJNDNmrAKv8xltcFJipHAmk9BrClMEq-0-34dd260477d344a3bd26556958408df0)
Using Rundeck, we can also schedule jobs to run at certain times and store the output in different formats. Rundeck also provides a REST API that can be integrated into the existing tool set.