Giter Club home page Giter Club logo

ansible-role-tuned's Introduction

Ansible Role: Tuned

Build Status Ansible Role

Installs and configures the tuned daemon for setting system tuning profiles. Supported on EL7.

Requirements

None.

Role Variables

The available built-in profiles on EL7 are:

  • balanced
  • desktop
  • latency-performance
  • network-latency
  • network-throughput
  • powersave
  • throughput-performance
  • virtual-guest
  • virtual-host

Change the active tuned profile using one of the built-in profiles above:

tuned_active_builtin_profile: "throughput-performance"

Change the active tuned profile by creating a custom tuned profile. See example below on how to build a custom tuned profile:

tuned_active_custom_profile: ""

Dependencies

None.

Example Playbooks

To use the role's default profile, throughput-performance, just apply the role:

- hosts: servers
  roles:
     - giovtorres.tuned

To use one of the other available built-in profiles, set the tuned_active_builtin_profile variable:

- hosts: servers
  vars:
    tuned_active_builtin_profile: "virtual-guest"
  roles:
     - giovtorres.tuned

To build a custom profile, create a dictionary using the tuned_active_custom_profile variable with the name and sections items, where sections contains the name of the section in the config file and a list of option/value pairs that go into that given section.

- hosts: all
  vars:
    tuned_active_custom_profile:
      name: my_custom_profile
      sections:
        - name: main
          params:
            - option: summary
              value: Test
            - option: include
              value: throughput-performance
        - name: sysctl
          params:
            - option: vm.dirty_ratio
              value: 30
            - option: vm.swappiness
              value: 30
        - name: vm
          params:
            - option: transparent_hugepages
              value: never
  roles:
    - giovtorres.tuned

The above playbook results in the following configuration output:

[main]
summary=Test
include=throughput-performance

[sysctl]
vm.dirty_ratio=30
vm.swappiness=30

[vm]
transparent_hugepages=never

License

BSD

ansible-role-tuned's People

Contributors

bhundven avatar giovtorres avatar jovial avatar prasadjlv avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-role-tuned's Issues

Deprecation warning

I got this warning just now after updating my Ansible installation

[DEPRECATION WARNING]: evaluating tuned_active_custom_profile as a bare variable, this behaviour will go away and you might need to add
 |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in version
2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
 ansible --version
ansible 2.8.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/holst/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, Jun 24 2019, 04:54:02) [GCC 9.1.0]

Fails to run when there is "No current active profile"

When all tunings are switched off (tuned-adm off) that results in:
[root@localhost] tuned-adm active
No current active profile.

This role fails to execute as shown below:

TASK [ansible-role-tuned : Get tuned profile.] ************************************************************************************************************************************************
task path: /etc/ansible/roles/ansible-role-tuned/tasks/main.yml:13
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/usr/sbin/tuned-adm", "active"], "delta": "0:00:00.140199", "end": "2018-03-15 23:21:45.311486", "msg": "non-zero return code", "rc": 1, "start": "2018-03-15 23:21:45.171287", "stderr": "", "stderr_lines": [], "stdout": "No current active profile.", "stdout_lines": ["No current active profile."]}

I believe it needs a simple ignore_errors: yes in tasks/main.yml. I will submit a PR, can you please review and approve it.

Thank you.

Release 1.1.1

Don't suppose we could get a fresh release on ansible galaxy? Hoping to use this with a newer version of ansible. Looks like there is only the new ansible bugfix since the last release: 1.1.0...master

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.