Giter Site home page Giter Site logo

geerlingguy / ansible-role-ansible Goto Github PK

View Code? Open in Web Editor NEW
147.0 11.0 87.0 46 KB

Ansible Role - Ansible

Home Page: https://galaxy.ansible.com/geerlingguy/ansible/

License: MIT License

ansible role install software setup pip python automation

ansible-role-ansible's Issues

How this role could be working ?

To be honest, I'm new to Ansible itself.
Does it make sense that installation of Ansible is possible by ansible-playbook ?
As I understand, installation of Ansible is prerequisite for running any playbook.
Please correct me if I have wrong information.
Thanks in advance.

Allow dependancies for pip installation

To install ansible via pip on fresh installs, it might needs somes dependancies (ex : gcc, python-devel, openssl-devel on RHEL)

Example in tasks.yml

- name: Install dependancies for pip installation.
  package:
    name: "{{ ansible_pip_dependancies }}"
    state: present

Invalid supported OS specification (the role is not working on Debian)

The role is said to support Debian, but it fails to install the ansible repository on Debian systems, like that:

TASK [ansible : Add ansible repository.] ***********************************
fatal: [host.example.com]: FAILED! => {"changed": false, "failed": true, "msg": "Invalid repository string: ppa:ansible/ansible"}

accordingly to the documentation: http://docs.ansible.com/ansible/apt_repository_module.html

# On Ubuntu target: add nginx stable repository from PPA and install its signing key.
# On Debian target: adding PPA is not available, so it will fail immediately.
apt_repository: repo='ppa:nginx/stable'

"The conditional check 'ansible_distribution_version < 9' failed"

I'm running Ansible 2.7.0 against a Debian Stretch server.

Ansible:

[user@ansible-host: /etc/ansible]$ ansible --version
ansible 2.7.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.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.0 (default, Sep 15 2018, 19:13:07) [GCC 8.2.1 20180831]

Playbook:

---
- hosts: "{{ server }}"
  become: true
  roles:
      - role: geerlingguy.ansible

The error I'm receiving:

TASK [geerlingguy.ansible : Set the default_release option for older Debian versions.] ********************************************************************************************************************************************
fatal: [cdc-s-ansibleci01]: FAILED! => {"msg": "The conditional check 'ansible_distribution_version < 9' failed. The error was: Unexpected templating type error occurred on ({% if ansible_distribution_version < 9 %} True {% else %} False {% endif %}): '<' not supported between instances of 'AnsibleUnsafeText' and 'int'[...]"}

I was able to resolve this by adding "| int" to ~/.ansible/roles/geerlingguy.ansible/tasks/setup-Debian.yml:

-when: ansible_distribution_version < 9
+when: ansible_distribution_version | int < 9

I am still learning, so I do not know what causes this issue, nor if this is the proper way to fix this.

Add possibility to add extra arguments to pip install ansible

Hi,

Nice script, I would however like to have the possibility to give an extra argument to the pip install command. In my case I would like to be able to pass on "--user".

I have created a PR to enable this that I will commit shortly.

Comments?

docs: Pip Executable var needs to be set

Actual Behaviour

If using the example playbook

The Task fails:

TASK [geerlingguy.ansible : Install Ansible via Pip.] **************************************************************************
fatal: [examle_host]: FAILED! => {"changed": false, "msg": "Unable to find any of  to use.  pip needs to be installed."}

Full run:

TASK [geerlingguy.pip : Ensure Pip is installed.] ******************************************************************************
ok: [examle_host]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] ************************************************************
skipping: [examle_host]

TASK [geerlingguy.ansible : Set the package state based on how Ansible is installed.] ******************************************
ok: [examle_host]

TASK [geerlingguy.ansible : Set up Ansible on RedHat.] *************************************************************************
skipping: [examle_host]

TASK [geerlingguy.ansible : Set up Ansible on Fedora.] *************************************************************************
skipping: [examle_host]

TASK [geerlingguy.ansible : Set up Ansible on Ubuntu.] *************************************************************************
skipping: [examle_host]

TASK [geerlingguy.ansible : Set up Ansible on Debian.] *************************************************************************
skipping: [examle_host]

TASK [geerlingguy.ansible : Set up Ansible using Pip.] *************************************************************************
included: /home/[example_user]/.ansible/roles/geerlingguy.ansible/tasks/setup-pip.yml for [example_host]

TASK [geerlingguy.ansible : Install Ansible via Pip.] **************************************************************************
fatal: [examle_host]: FAILED! => {"changed": false, "msg": "Unable to find any of  to use.  pip needs to be installed."}

Solution

The ansible_pip_executable: pip3 needs to be set as in the CI build

Error on playbook for Ubuntu 20

Hey,
I'm trying to run this role and I get:

TASK [geerlingguy.ansible : Add ansible repository.] ****************************************************************************
fatal: [192.168.1.14]: FAILED! => {"changed": false, "msg": "apt cache update failed"}

Ansible Galaxy installation issue

Hi,

unfortunately, this role is not installable via Ansible Galaxy due to strange error: https://galaxy.ansible.com/list#/roles/1007. As you can see there's some weird issue with role name under Installation section: $ ansible-galaxy install geerlingguy..

The output of the installation process via ansible-galaxy:

andrzej@PC:~/workspace$ ansible-galaxy install -r requirements.yml
- downloading role 'ansible', owned by geerlingguy
- sorry, geerlingguy.ansible was not found on galaxy.ansible.com.
- you can use --ignore-errors to skip failed roles.

Allow define umask

To install system wide, if we have defined different default umask, it might be usefull to add umask to the setup-pip.yml

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.