0x0i.tmux

ansible logo

tmux logo

Ansible Role: tmux

Galaxy Role GitHub release (latest by date) License: MIT

Table of Contents

This Ansible role installs, sets up, and runs tmux, which allows you to use multiple terminal sessions at once on a single screen.

Supported Platforms:
* Debian
* Redhat (CentOS/Fedora)
* Ubuntu

Requirements

You need to have the following software installed before using this role:

Role Variables

You can customize the following stages of software and machine setup:

  • install
  • config
  • uninstall

Install

You can install tmux using the package management tools of the supported platforms (like apt or yum/dnf).

You can customize these variables for your installation:

service_package: <package-name-and-version> (default: tmux[-latest])

  • The name and version of the tmux package to download and install. You can find available packages here or use a terminal command like dnf --showduplicates list tmux.

Config

You can configure your tmux using the tmux_config variable. This configuration can be organized by user account and includes commands and optional comments.

Here’s an example configuration:

tmux_config:
  global:
    - comment: "This comment gives context"
      commands:
        - "source-file": "'~/.tmux.conf'"

Each command can be written in different formats, but they should follow the {command}: {flags} pattern:

tmux_config:
  global:
    - comment: "Set ctrl-A as secondary prefix key"
      commands:
        - "set-option": "-g prefix2 C-a"
        - "bind-key": "C-a send-prefix -2"

You can also mix command formats in your configuration.

Uninstall

To remove the tmux installation and user configurations, set the following variable:

perform_uninstall: <true | false> (default: false)

  • Whether to uninstall the tmux package and user configurations. See handlers/main.yml for more details.

Dependencies

None

Example Playbook

Basic example:

- hosts: all
  roles:
  - role: 0x0I.tmux

To install a specific version:

- hosts: all
  roles:
  - role: 0x0I.tmux
    vars:
      service_package: tmux-2.7-2

To manually apply tmux plugin settings:

- hosts: all
  roles:
  - role: 0x0I.tmux
    vars:
      tmux_config:
        global:
          - comment: "Enable utf8"
            commands:
              - "set-option": "-g utf8 on"
              - "set-option": "-g status-utf8 on"

...or with a plugin:

- hosts: all
  roles:
  - role: 0x0I.tmux
    vars:
      tmux_config:
        global:
          - comment: "Add sensible to list of plugins"
            commands:
              - "set-option": "-g @plugin 'tmux-plugins/tmux-sensible'"

License

MIT

Author Information

This role was created in 2019 by O1.IO.

Informazioni sul progetto

tmux, a terminal multiplexer enabling multiple terminals to be created, accessed, and controlled from a single screen

Installa
ansible-galaxy install 0x0i.tmux
Licenza
Unknown
Download
299
Proprietario