Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Struggling with user accounts
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bruce  
View profile  
 More options Nov 14 2012, 4:00 pm
From: Bruce <bpennypac...@care.com>
Date: Wed, 14 Nov 2012 13:00:50 -0800 (PST)
Local: Wed, Nov 14 2012 4:00 pm
Subject: Struggling with user accounts

I'm still trying to wrap my head around ansible in general and I guess I
just don't understand its structure fully yet.  The very first thing I'm
attempting to do is to create some user accounts across a group of servers.
 We have a handful of sysadmins who manage a group of servers, so I figured
I could so something along these lines to define how we want an account
created:

  tasks:
     -name: Add user ${username}
     action: command /bin/echo ${username}
    - name: Add/remove user ${username}
      action: user name=${username}
              comment="${fullname}"
              uid=${uid}
              group=wheel
              shell=/bin/bash
              createhome=yes
              state=present

    - name: Add ssh key for ${username}
      action: authorized_key user=${username}
key="$FILE(/ansible/conf/users/files/ssh-key.${username})"

    - name: Add user ${username} to nagios group on the util server only
      action: user name=${username}
              groups=nagios
      only_if: "'$facter_hostname'== 'util'"

But then for the life of me I can't figure out how to apply this playbook
for each of the sets of username/fullname/uid that I need to create
accounts for.  Is this a good way of doing this sort of thing or am I
completely missing the boat?

-Bruce


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.