Git Product home page Git Product logo

Comments (3)

camdixon avatar camdixon commented on August 13, 2024

Also,

In your meta file you mention min_ansible_version: 1.9 however use import_tasks functionality in the role based on OS Family. This will need to be updated to min_ansible_version: 2.4.

http://docs.ansible.com/ansible/latest/modules/import_tasks_module.html

As an example in your role -> tasks/main.yaml

- name: Import signalfx-agent deploy for CentOS or RHEL
  import_tasks: yum_repo.yml
  when: ansible_os_family in rhel_distro

from signalfx-agent.

camdixon avatar camdixon commented on August 13, 2024

TASK [signalfx-agent-install : Add an Apt signing key for Signalfx Agent] ***************************
fatal: [sc-cbs-hub01]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key --keyring /etc/apt/trusted.gpg.d/signalfx.gpg add -", "msg": "ERROR: This command can only be used by root.", "rc": 1, "stderr": "ERROR: This command can only be used by root.\n", "stderr_lines": ["ERROR: This command can only be used by root."], "stdout": "", "stdout_lines": []}

In the roles -> signalfx-agent/tasks/debian_repo.yml

---
- name: Add an Apt signing key for Signalfx Agent
  apt_key:
    url: "{{ repo_base_url }}/debian.gpg"
    keyring: /etc/apt/trusted.gpg.d/signalfx.gpg
    state: present
  become: yes

Adding become: yes fixes this, and allows use of a vault password or ansible-playbook -K playbook-name.yml This will use the sudo user specified in your example playbook

Also applied to other 2 tasks in this file, because permission denied error received with these tasks.

from signalfx-agent.

rmfitzpatrick avatar rmfitzpatrick commented on August 13, 2024

@camdixon, we've updated the ansible role and uploaded it to Galaxy with corrected version information. Thank you for your notes and patience.

ansible-galaxy install signalfx.smart_agent

You can invoke the role by the same name (as opposed to signalfx-agent if using the source tree).

As far as adding explicit privilege escalation for the yum/apt tasks, I'm opting for that to be left to the user in their role or ansible-playbook invocation. If you feel this is an oversight, please open another issue and include your use case and why global or role-level directives aren't acceptable.

from signalfx-agent.

Related Issues (20)

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.