# Add user to "administrators" group or "administrateurs" group

**URL:** <https://forum.ansible.com/t/add-user-to-administrators-group-or-administrateurs-group/24922>\
**Category:** Ansible Project\
**Created:** [July 7, 2017, 12:08pm UTC](https://forum.ansible.com/t/add-user-to-administrators-group-or-administrateurs-group/24922 "2017-07-07T12:08:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fanchfanch44](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@fanchfanch44](https://forum.ansible.com/u/fanchfanch44)\
**Post date:** [July 7, 2017, 12:08pm UTC](https://forum.ansible.com/t/add-user-to-administrators-group-or-administrateurs-group/24922/1 "2017-07-07T12:08:13Z")

</div>

Hello,

I would like to create a playbook that adds a user to the administrators group. This action is simple and is an example. But my problem is that I have servers in FR and the group is not administrators but administrators.

I saw that you could make conditions in the playbooks but I do not know how to test if I am on an OS FR or US.

Could you advise me?

Thank you beforehand.

Regards

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 10, 2017, 8:04pm UTC](https://forum.ansible.com/t/add-user-to-administrators-group-or-administrateurs-group/24922/2 "2017-07-10T20:04:56Z")

</div>

I suggest you run the ‘setup’ module against your hosts, and use one of the facts to find out if the machine is FS or US.

For windows hosts, ansible\_facts.ansible\_env.USERNAME might be enough. If that isn’t enough, on windows hosts you can use the Get-Culture cmdlet to find out which culture is current on your host. Something like this.

- name: culture test  
hosts: 12,  
gather\_facts: false  
tasks:

- name: get culture  
win\_shell: Get-Culture|select Name|convertto-json -depth 1  
register: culture\_raw

- name: debug culture\_raw  
debug:  
var: culture\_raw

- name: set culture fact  
set\_fact:  
culture: “{{culture\_raw.stdout|from\_json}}”

- name: debug culture  
debug:  
var: culture

- name: do things when culture is en-US  
debug:  
msg: Doing en-US things  
when: culture.Name == ‘en-US’

- name: do things when culture is something else  
debug:  
msg: Doing non-en-US things  
when: culture.Name != ‘en-US’
