ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Scripting - How do you store your credentials and call them later?

    Scheduled Pinned Locked Moved Solved IT Discussion
    shellscriptcredentialshashing
    79 Posts 7 Posters 6.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403 @stacksofplates
      last edited by

      @stacksofplates said in Scripting - How do you store your credentials and call them later?:

      @IRJ said in Scripting - How do you store your credentials and call them later?:

      You may be able to do something like this? @stacksofplates can probably chime in

      192.168.1.[1:254]

      You can do something like that and even mac[1:3000].test.com, but it's valuable to have each system defined so you can control variables for each one. It's fairly trivial to export from your asset management system and make an inventory from that.

      This is only true if I get to hit my coworker with a hammer

      1 Reply Last reply Reply Quote 0
      • stacksofplatesS
        stacksofplates @DustinB3403
        last edited by

        @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

        @stacksofplates so that seems simple enough, how do you put in the custom details like I am pushing to these 1 by 1?

        the office location, the expected user and the asset tag to create a single -computername ?

        Also since we're on it, how do you use tools like brew.sh to install and update third party software?

        For brew there's a module to interact with it. You just declare the package you want installed and it does it.

        - name: Ensure foo is installed
          homebrew:
            name: foo
            state: present
        

        You can also do multiple:

        - name: Ensure packages are installed
          homebrew:
            name: "{{ item }}"
            state: present
          loop:
            - softwareA
            - softwareB
            - softwareC
        DustinB3403D 1 Reply Last reply Reply Quote 0
        • DustinB3403D
          DustinB3403 @stacksofplates
          last edited by

          @stacksofplates do you install the role or module? I looked at this before and the documentation is lacking.

          stacksofplatesS 1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            I know I'm asking a lot, but it's because when I have asked in the past it was a RTFM response.

            Which doesn't really fix the issue of the documentation is lacking or convoluted for what the platform is.

            And I know these tools aren't designed to manage user workstations, but can do it. Thus the interest.

            So if you're willing to explain and answer my million questions, I'll be happy to test.

            stacksofplatesS 1 Reply Last reply Reply Quote 1
            • stacksofplatesS
              stacksofplates @DustinB3403
              last edited by

              @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

              @stacksofplates do you install the role or module? I looked at this before and the documentation is lacking.

              The modules are part of the Ansible install. You don't need to install them separately unless you write your own. A role is like a library. It's a set of tasks you write to accomplish something and you can call it like a function or library.

              For example I have a role I wrote that installs and enables firewalld and sets the ports/services you define. But I can call that role and pass in different ports and services for different hosts and groups because it's like a function.

              1 Reply Last reply Reply Quote 0
              • stacksofplatesS
                stacksofplates @DustinB3403
                last edited by

                @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

                I know I'm asking a lot, but it's because when I have asked in the past it was a RTFM response.

                Which doesn't really fix the issue of the documentation is lacking or convoluted for what the platform is.

                And I know these tools aren't designed to manage user workstations, but can do it. Thus the interest.

                So if you're willing to explain and answer my million questions, I'll be happy to test.

                I don't find it convoluted but it doesn't really matter, I'll do my best to answer whatever I can for you.

                1 Reply Last reply Reply Quote 0
                • DustinB3403D
                  DustinB3403
                  last edited by

                  @stacksofplates so how do I check to see if this role is installed?

                  https://github.com/geerlingguy/ansible-role-homebrew because this seems like the thing people recommend using

                  1 Reply Last reply Reply Quote 0
                  • DustinB3403D
                    DustinB3403
                    last edited by

                    Fedora Server 30 - with ansible --version 3.7.3 installed

                    stacksofplatesS 1 Reply Last reply Reply Quote 0
                    • stacksofplatesS
                      stacksofplates @DustinB3403
                      last edited by stacksofplates

                      @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

                      Fedora Server 30 - with ansible --version 3.7.3 installed

                      Can't be 3.7.3. They just released 2.8 less than a month ago (that's the Python version).

                      To install a role use ansible-galaxy. So you would run:

                      ansible-galaxy install geerlingguy.homebrew
                      

                      If you go to the galaxy site for the roles it gives you all of the info: https://galaxy.ansible.com/geerlingguy/homebrew

                      galaxy.png

                      1 Reply Last reply Reply Quote 0
                      • DustinB3403D
                        DustinB3403
                        last edited by

                        whoops thats the python version lol (no glasses) ansible version 2.8.1

                        1 Reply Last reply Reply Quote 0
                        • DustinB3403D
                          DustinB3403
                          last edited by

                          Okay so let me make a new topic for this as this is getting more indepth.

                          1 Reply Last reply Reply Quote 0
                          • ObsolesceO
                            Obsolesce @DustinB3403
                            last edited by Obsolesce

                            @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

                            PS I learn from seeing and doing, rather than reading. Just as an FYI.

                            How do you learn what to do without reading or seeing how TF to do it first? Not capable of learning on your own, is that what you are saying?

                            I'm sure there are Ansible classes, courses, videos, etc out there.

                            DustinB3403D 1 Reply Last reply Reply Quote -1
                            • DustinB3403D
                              DustinB3403 @Obsolesce
                              last edited by

                              @Obsolesce get bent, learning from seeing and doing is a form of learning.

                              ObsolesceO 1 Reply Last reply Reply Quote 0
                              • ObsolesceO
                                Obsolesce @DustinB3403
                                last edited by Obsolesce

                                @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

                                @Obsolesce get bent, learning from seeing and doing is a form of learning.

                                So by hand-holding only? No offense, just trying to understand what you mean by seeing.

                                DustinB3403D 1 Reply Last reply Reply Quote 0
                                • DustinB3403D
                                  DustinB3403 @Obsolesce
                                  last edited by

                                  @Obsolesce said in Scripting - How do you store your credentials and call them later?:

                                  @DustinB3403 said in Scripting - How do you store your credentials and call them later?:

                                  @Obsolesce get bent, learning from seeing and doing is a form of learning.

                                  So by hand-holding only? No offense, just trying to understand what you mean by seeing.

                                  By seeing how others have done something, by having someone who has done it before. Than when RTFM doesn't explain clearly what the hell is going on.

                                  It's not hand holding to ask a question here is it? If so we'd all better close our accounts or only post meme's about spiceworks.

                                  1 Reply Last reply Reply Quote 0
                                  • IRJI
                                    IRJ
                                    last edited by

                                    When posting to ML, one must always be ready to square up ....

                                    b42bb973-54a1-476b-addb-7245719a0843-image.png

                                    pmonchoP 1 Reply Last reply Reply Quote 1
                                    • pmonchoP
                                      pmoncho @IRJ
                                      last edited by

                                      @IRJ

                                      I come mentally prepared with my powerful Crane! 🙂
                                      alt text

                                      1 Reply Last reply Reply Quote 1
                                      • 1
                                      • 2
                                      • 3
                                      • 4
                                      • 2 / 4
                                      • First post
                                        Last post