Skip to content

Instantly share code, notes, and snippets.

@tsuchm
Last active April 8, 2025 04:00
Show Gist options
  • Save tsuchm/5448af4dc2fb89f60a748ed172a2aa69 to your computer and use it in GitHub Desktop.
Save tsuchm/5448af4dc2fb89f60a748ed172a2aa69 to your computer and use it in GitHub Desktop.
shellinabox-install-playbook.yml

Because shellinaboxd RPM package is removed from EPEL official repository, it is necessary to build it by ourselves. Follow the following steps.

  1. Download the source RPM package from: https://src.fedoraproject.org/rpms/shellinabox

  2. Install it on your home directory:

$ rpm -i shellinabox-2.20-26.fc43.src.rpm

This command must create required directories in ~/RPM/.

  1. Build it.
$ rpmbuild -bb RPM/SPECS/shellinabox.spec

Note that the root privilege is not required the above step.

  1. Install the binary package.
$ sudo rpm -ivh RPM/RPMS/x86_64/shellinabox-2.20-26.el9.x86_64.rpm
- hosts: all
vars:
rpm_path: shellinabox-2.20-26.el9.x86_64.rpm
rpm_name: shellinabox
tasks:
- name: Gather installed package facts
package_facts:
manager: auto
check_mode: no
- name: Copy binary package if not installed
copy:
src: "{{ rpm_path }}"
dest: "/tmp/{{ rpm_path }}"
when: rpm_name not in ansible_facts.packages
- name: Install rpm package if not installed
yum:
name: "/tmp/{{ rpm_path }}"
state: present
disable_gpg_check: yes
when: rpm_name not in ansible_facts.packages
ignore_errors: "{{ ansible_check_mode }}"
- name: Delete rpm binary package file after installation
file:
path: "/tmp/{{ rpm_path }}"
state: absent
when: rpm_name not in ansible_facts.packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment