jsvc

Ansible Role: jsvc

CI CD

Compile the Apache Commons Daemon, aka jsvc, on RedHat/CentOS and Debian/Ubuntu.

This role downloads and compiles the latest source code from Apache Commons (link), and copies the binary to /usr/bin/. Optionally, it will remove the JDK and source code directory.

If you would like to manually download the source code to your Ansible control host, download the native-src, commons-daemon-*.*.*-native-src.tar.gz, to your files directory and set the following two variables in your playbook:

  • jsvc_tar_src: commons-daemon-*.*.*-native-src.tar.gz
  • jsvc_tar_src_remote: false

Install the Role

You can install this role with the Ansible Galaxy CLI:

ansible-galaxy role install trfore.jsvc

You can also include it in a requirements.yml file and install it with ansible-galaxy install -r requirements.yml, using the format:

---
roles:
  - trfore.jsvc

Tested Platforms

  • ansible-core 2.15, 2.16 & 2.17
  • CentOS Stream 8 & 9
    • Note CentOS 8 defaults to python 3.6 and is not supported in ansible-core 2.17
  • Debian 10 & 11
  • Ubuntu 20.04, 22.04 & 24.04

Requirements

None

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

Variable Default Description Required
jsvc_src_version 1.4.0 Apache Commons' Daemon latest release No
jsvc_tar_src URL Apache Commons' Daemon native source tar file, URL or relative path No
jsvc_tar_src_remote true Boolean, true if downloading from URL No
jsvc_tar_dir /var/tmp Temporary directory on the target host for extracting and compiling the source code No
jsvc_tar_folder Automatic Determined from the jsvc_tar_src variable Automatic
jsvc_build_dependencies ["autoconf", "make", "gcc"] Packages for compiling the source code No
jsvc_remove_jdk false Boolean, uninstall the Java JDK after build No
jsvc_remove_tar_folder false Boolean, remove the source code temporary directory on the target host No

OS specific variables are listed below, along with default values (see vars/main.yml):

Variable Default Description Required
jsvc_build_jdk openjdk-11-jdk-headless Java JDK (Debian) No
jsvc_build_jdk java-11-openjdk-devel.x86_64 Java JDK (RHEL) No

Dependencies

None

Example Playbook

- hosts: servers
  become: true
  roles:
    - name: Compile jsvc binary
      role: trfore.jsvc
  • If you manually download the tar file & wish to remove the JDK and source dir.
- hosts: servers
  become: true
  vars:
    jsvc_tar_src: commons-daemon-1.4.0-native-src.tar.gz
    jsvc_tar_src_remote: false
    jsvc_remove_jdk: true
    jsvc_remove_tar_folder: true
  roles:
    - name: Compile jsvc binary
      role: trfore.jsvc

License

MIT

Author Information

Taylor Fore (https://github.com/trfore)

Github Ansible Galaxy
ansible-role-jsvc trfore.jsvc
ansible-role-mongodb-install trfore.mongodb_install
ansible-role-omada-install trfore.omada_install

References

Apache Commons Daemon / jsvc

About

Compile the Apache Commons Daemon, aka jsvc, binary on RedHat/CentOS and Debian/Ubuntu.

Install
ansible-galaxy install trfore/ansible-role-jsvc
GitHub repository
License
mit
Downloads
380