Feature users config ssh #9 #10

Merged
srgvg merged 10 commits from feature-users-config-ssh-#9 into master 2018-09-02 06:45:47 +00:00
17 changed files with 431 additions and 0 deletions
Showing only changes of commit 95e4ee8c06 - Show all commits

View file

@ -0,0 +1,9 @@
# Users and ssh-configAnsible roles
This repo contains 2 roles:
- **users**: Add users and configure `.bashrc` and `authorized_keys`
- **ssh-config**: Configures a user's `~/.ssh/config`
Both roles make use of the same _users_ variable and are created to give users the freedom to add their own configuration outside of Ansible.
Detailed configuration can be found in the README files inside the role's folders.

View file

@ -0,0 +1,17 @@
[ssh_connection]
[defaults]
retry_files_enabled = False
retry_files_save_path = /tmp/
inventory=./hosts
host_key_checking=False
gathering = smart
#stdout_callback=unixy
stdout_callback=debug
[privilege_escalation]
become=True
become_method=sudo
become_user=root
#become_ask_pass=False

View file

@ -0,0 +1,35 @@
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
---
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
user_groups:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- name: mygroup
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
gid: 700
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- name: mysecondgroup
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
gid: 702
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: absent
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
users:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- name: remember
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: present
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
password: "blabla"
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
groups:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- mygroup
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
uid: 1100
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
keys:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- file: key1
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: present
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
shell_lines:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- line: "testline"
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: present
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: present
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- line: "alias ls='ls lah'"
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: present
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
ssh_config:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- ServerAliveInterval: 10
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- name: test
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
keys:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- file: key2
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: absent
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
shell_lines:
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
- line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.
state: present
reelsense commented 2018-08-20 23:36:07 +00:00 (Migrated from github.com)
Review

TASK [users : Ensure .ssh folder is created] fails if user is set to absent after it was previously present.

  (Click to expand code)
TASK [users : Ensure .ssh folder is created] *******************************************************
failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => {
    "changed": false, 
    "gid": 1100, 
    "group": "1100", 
    "item": {
        "bash_lines": [
            {
                "line": "testline", 
                "state": "present"
            }, 
            {
                "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", 
                "state": "present"
            }, 
            {
                "line": "alias ls='ls lah'", 
                "state": "present"
            }
        ], 
        "groups": [
            "mygroup"
        ], 
        "keys": [
            {
                "file": "key1", 
                "state": "present"
            }
        ], 
        "name": "remember", 
        "ssh_config": [
            {
                "ServerAliveInterval": 10
            }
        ], 
        "state": "absent", 
        "uid": 1100
    }, 
    "mode": "0700", 
    "owner": "1100", 
    "path": "/home/remember/.ssh", 
    "size": 4096, 
    "state": "directory", 
    "uid": 1100
}

MSG:

chown failed: failed to look up user remember

ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]})

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=8    changed=1    unreachable=0    failed=1   
`TASK [users : Ensure .ssh folder is created]` fails if user is set to `absent` after it was previously `present`. <details>   <summary>(Click to expand code)</summary> ```yaml TASK [users : Ensure .ssh folder is created] ******************************************************* failed: [127.0.0.1] (item={u'bash_lines': [{u'line': u'testline', u'state': u'present'}, {u'line': u'export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh', u'state': u'present'}, {u'line': u"alias ls='ls lah'", u'state': u'present'}], u'name': u'remember', u'keys': [{u'state': u'present', u'file': u'key1'}], u'ssh_config': [{u'ServerAliveInterval': 10}], u'state': u'absent', u'groups': [u'mygroup'], u'uid': 1100}) => { "changed": false, "gid": 1100, "group": "1100", "item": { "bash_lines": [ { "line": "testline", "state": "present" }, { "line": "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh", "state": "present" }, { "line": "alias ls='ls lah'", "state": "present" } ], "groups": [ "mygroup" ], "keys": [ { "file": "key1", "state": "present" } ], "name": "remember", "ssh_config": [ { "ServerAliveInterval": 10 } ], "state": "absent", "uid": 1100 }, "mode": "0700", "owner": "1100", "path": "/home/remember/.ssh", "size": 4096, "state": "directory", "uid": 1100 } MSG: chown failed: failed to look up user remember ok: [127.0.0.1] => (item={u'keys': [{u'state': u'absent', u'file': u'key2'}], u'name': u'test', u'csh_lines': [{u'line': u'alias ls ls -lah', u'state': u'present'}]}) PLAY RECAP ***************************************************************************************** 127.0.0.1 : ok=8 changed=1 unreachable=0 failed=1 ``` </details>
reelsense commented 2018-08-20 23:48:26 +00:00 (Migrated from github.com)
Review

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.

I guess the procedure I should use is. When a user is removed. Remove their variables so the script continues to function. Because the variables try to set because the home folder exists even though the user is gone.
reelsense commented 2018-08-23 21:21:05 +00:00 (Migrated from github.com)
Review

If I add a user to a group: admin. I can't remove the user from a group. Please advise if there is a method I've over looked.

If I add a user to a group: `admin`. I can't remove the user from a group. **Please advise** if there is a method I've over looked.
reelsense commented 2018-08-23 21:23:33 +00:00 (Migrated from github.com)
Review

I can add but not remove, multiline bash entries.

users:
  - name: remember
    state: present
    groups:
      - mygroup
    uid: 1100
    keys:
      - file: key1
        state: present
    bash_lines:
      - line: "testline"
        state: absent
      - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
        state: present
      - line: "alias ls='ls -lah'"
        state: present
      - line: |
         #this is a testline
         #this is a testline2         
        state: absent
    ssh_config:
      - ServerAliveInterval: 10
I can add but not remove, multiline bash entries. ```yaml users: - name: remember state: present groups: - mygroup uid: 1100 keys: - file: key1 state: present bash_lines: - line: "testline" state: absent - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh" state: present - line: "alias ls='ls -lah'" state: present - line: | #this is a testline #this is a testline2 state: absent ssh_config: - ServerAliveInterval: 10 ```
reelsense commented 2018-08-23 21:27:43 +00:00 (Migrated from github.com)
Review

Please advise.

**Please advise**.
vincentvdk commented 2018-08-26 11:50:56 +00:00 (Migrated from github.com)
Review

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.

We'll have to make the 'users.state' variable required. I'll make the necessary changes to the tasks and check for required variables at runtime.
vincentvdk commented 2018-08-26 13:15:17 +00:00 (Migrated from github.com)
Review

the 'user' module ws using the 'append' option. This will be removed

the 'user' module ws using the 'append' option. This will be removed
vincentvdk commented 2018-08-26 13:16:01 +00:00 (Migrated from github.com)
Review

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.

I updated the playbooks to add a task for multi line content leveraging the 'blockinfile' module.
vincentvdk commented 2018-08-26 13:16:49 +00:00 (Migrated from github.com)
Review

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

I made the necessary changes and commited everything to @srgvg his repository so he can make a proper PR here.

View file

@ -0,0 +1,3 @@
10.106.116.157 ssh_short_name=host1 ansible_user=root
10.106.116.139 ssh_short_name=host2 ansible_user=root
34.242.108.38 ssh_short_name=freebsd1 ansible_user=ec2-user ansible_python_interpreter=/usr/local/bin/python2.7

View file

@ -0,0 +1,89 @@
# ssh-config
Ansible role to configure a user's `~/.ssh/config` file. This will add a
configuration in the ssh config file for each host in the inventory.
**NOTE: this role works in conjunction with the _users_ variable**
## Variables
| _variable name_ | Description |
| ---: |--- |
| ssh_short_name | host identifier name in the ssh config.<br>This should be added to the _host variables_ |
| ssh_config | name of the key in the *users* variable. Contains a list of
key/value items|
## Example:
**Host inventory**
```
10.106.116.157 ssh_short_name=host1
10.106.116.139 ssh_short_name=host2
```
**Variables**
populate the *ssh_config* key.
```
users:
- name: remember
state: present
password: "blabla"
groups:
- mygroup
uid: 1100
keys:
- file: key1
state: present
shell_lines:
- line: "testline"
state: present
- line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
state: present
- line: "alias ls='ls lah'"
state: present
ssh_config:
- ServerAliveInterval: 10
```
**Result:**
```
# BEGIN ANSIBLE MANAGED BLOCK
Host host1
Hostname 10.106.116.157
RemoteForward /home/remember/.gnupg/S.gpg-agent $HOME/.gnupg/S.gpg-agent
RemoteForward /home/remember/.gnupg/S.gpg-agent.ssh $HOME/.gnupg/S.gpg-agent.ssh
ServerAliveInterval 10
Host host2
Hostname 10.106.116.139
RemoteForward /home/remember/.gnupg/S.gpg-agent $HOME/.gnupg/S.gpg-agent
RemoteForward /home/remember/.gnupg/S.gpg-agent.ssh $HOME/.gnupg/S.gpg-agent.ssh
ServerAliveInterval 10
# END ANSIBLE MANAGED BLOCK
```
**Break down**
The host identifier is populated with the `ssh_short_name` host variable.
```
Host host1
```
The `Hostname` is populated with the `inventory_hostname` variable
```
Hostname 10.106.116.139
```
These lines are added by default:
```
RemoteForward /home/remember/.gnupg/S.gpg-agent $HOME/.gnupg/S.gpg-agent
RemoteForward /home/remember/.gnupg/S.gpg-agent.ssh $HOME/.gnupg/S.gpg-agent.ssh
```
Everything below this is populated with the key/values defined in the
`ssh_config` list of the `users` variable
```
ServerAliveInterval 10
```

View file

@ -0,0 +1,44 @@
---
- name: Check if user has ~/.ssh/config
stat:
path: "/home/{{ item.name }}/.ssh/config"
with_items: "{{ users }}"
register: sshconfig
- name: Create ~/.ssh/config when absent
file:
path: "/home/{{ item.item.name }}/.ssh/config"
owner: "{{ item.item.name }}"
group: "{{ item.item.name }}"
mode: 0600
state: touch
when: item.stat.exists == False
with_items:
- "{{ sshconfig.results }}"
no_log: True
- name: Configure ~/.ssh/config
blockinfile:
path: "/home/{{ item.0.name }}/.ssh/config"
owner: "{{ item.0.name }}"
group: "{{ item.0.name }}"
mode: 0600
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: |
{% for host in groups['all'] -%}
Host {{ hostvars[host]['ssh_short_name'] }}
Hostname {{ hostvars[host]['inventory_hostname'] }}
RemoteForward /home/{{ item.0.name }}/.gnupg/S.gpg-agent $HOME/.gnupg/S.gpg-agent
RemoteForward /home/{{ item.0.name }}/.gnupg/S.gpg-agent.ssh $HOME/.gnupg/S.gpg-agent.ssh
{% for k,v in item.1.items() %}
{% if k|lower != "host" and k|lower != "hostname" %}
{{k}} {{v}}
{% endif %}
{% endfor %}
{% endfor %}
with_subelements:
- "{{ users }}"
- ssh_config
- skip_missing: true

View file

@ -0,0 +1,109 @@
# Users
Ansible roles to create/configure users on Linux/FreeBSD.
## Variables
| user_groups | | |
| ---: |--- |--- |
| name | name of the group | Data type |
| gid | Optionally set the group ID | int |
| state | whether the group shoud be created or removed | present/absent |
| users | | |
| ---: |---| ---|
| _variable name_ | Description | Data type |
| name | username | string |
| state | whether the user should be created or removed | present/absent |
| password | string of an encrypted value(1) | string |
| groups | additional groups the user should belong to | list |
| uid | optionally specify a user id | int |
| keys | list of dictionaries | list |
| shell_lines | list of dictionaries | list |
(1) https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module
## Default variables
The default shells depending on the OS are:
- Linux: `/bin/bash`
- FreeBSD: `/bin/cshrc`
This is defined in the `defaults` section of the **users** role
## Example inventory
```
user_groups:
- name: mygroup
gid: 700
users:
- name: remember
state: present
password: "blabla"
groups:
- mygroup
uid: 1100
keys:
- file: key1
state: present
shell_lines:
- line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
state: present
- line: "alias ls='ls lah'"
state: present
- name: test
keys:
- file: key2
state: absent
shell_lines:
- line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
state: absent
```
## Using the Role
### Example Playbook
```
---
- name: Manage user configuration
hosts: all
remote_user: root
roles:
- users
```
### Configure a user's ssh keys
For every user a directory matching the username should be created under the _keys_ folder in the role's _files_ folder. In this folder the user's ssh keys can be stored.
```
├── files
│   └── keys
│   ├── remember
│   │   └── key1.pub
│   └── test
│   └── key2.pub
```
The name of the file holding the key should match the name in the _users_ variable
```
keys:
- file: key1
state: present
```
### Configure a user's shell
This role allows you to add or remove lines to a user's `.bashrc` or `cshrc` file. Since this is not based on a template that overwrites the complete file, users can still add their own configuration too.
Add items to the **shell_lines** key in the **users** variable. Each item exists of a _line_ and _state_ key.
Example:
```
shell_lines:
- line: "testline"
state: absent
- line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
state: present
- line: "alias ls='ls lah'"
state: present
```

View file

@ -0,0 +1,4 @@
default_freebsd_shell: "/bin/csh"
default_linux_shell: "/bin/bash"
default_shell_lines:
- SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh

View file

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMfztaQoo3Alf4Ie4ZrSEkhojOcKl8VRdoRiYb/7FL3IS/5IcSKcan/MGJlRht3ibwJBx9/CY8wZivHgNKCqtbZWGepfOtgWOqI4ROo4sELmRgV8PZUACjCSfaOkOdvCJEjhw3n+aI5jmK9IUA+mwdXkZj/NckNDZAQ+FRqwR6sX7svM4TF/zEI70JvO3xnDgCuC2PgiztVFfMqbWl33NgkG3kWkJ+JarF2pNsxO/+82s/hoC4P+dpZD1PHhJC7OxUiAHe5nwF7heQh9DUBQxJBhitn7C3XqlxEf7Kx3/kO9CUJVDaxS84UUnfUPc0u1iYpE+5ypqkDSyj3yQNpwXf

View file

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMfztaQoo3Alf4Ie4ZrSEkhojOcKl8VRdoRiYb/7FL3IS/5IcSKcan/MGJlRht3ibwJBx9/CY8wZivHgNKCqtbZWGepfOtgWOqI4ROo4sELmRgV8PZUACjCSfaOkOdvCJEjhw3n+aI5jmK9IUA+mwdXkZj/NckNDZAQ+FRqwR6sX7svM4TF/zEI70JvO3xnDgCuC2PgiztVFfMqbWl33NgkG3kWkJ+JarF2pNsxO/+82s/hoC4P+dpZD1PHhJC7OxUiAHe5nwF7heQh9DUBQxJBhitn7C3XqlxEf7Kx3/kO9CUJVDaxS84UUnfUPc0u1iYpE+5ypqkDSyj3yQNpwXd

View file

@ -0,0 +1,4 @@
---
- include_tasks: set_facts.yml
- include_tasks: users.yml
- include_tasks: ssh_config.yml

View file

@ -0,0 +1,8 @@
- set_fact:
default_shell: "{{ default_freebsd_shell }}"
when: ansible_os_family == 'FreeBSD'
- set_fact:
default_shell: "{{ default_linux_shell }}"
when: ansible_os_family == 'Debian'

View file

@ -0,0 +1,20 @@
- name: Ensure .ssh folder is created
file:
path: "/home/{{item.name}}/.ssh"
state: directory
mode: 0700
owner: "{{ item.name }}"
group: "{{ item.name }}"
with_items:
- "{{ users }}"
- name: Configure authorized_keys
authorized_key:
user: "{{ item.0.name }}"
key: "{{ lookup('file', 'keys/' + item.0.name + '/' + item.1.file + '.pub') }}"
state: "{{ item.1.state | default('present') }}"
with_subelements:
- "{{ users }}"
- keys

View file

@ -0,0 +1,46 @@
---
- name: Ensure groups exist
group:
name: "{{ item.name }}"
gid: "{{ item.gid | default(omit) }}"
state: "{{ item.state | default('present') }}"
with_items: "{{ user_groups }}"
- name: Ensure users exist
user:
name: "{{ item.name }}"
state: "{{ item.state | default('present') }}"
password: "{{ item.password | default(omit) }}"
groups: "{{ item.groups | default(omit) }}"
uid: "{{ item.uid | default(omit) }}"
shell: "{{ item.shell | default(default_shell) }}"
append: yes
no_log: True
with_items: "{{ users }}"
- name: Configure bashrc
lineinfile:
path: "/home/{{ item.0.name }}/.bashrc"
line: "{{ item.1.line }}"
state: "{{ item.1.state | default('present') }}"
backup: yes
with_subelements:
- "{{ users }}"
- shell_lines
- skip_missing: true
when: ansible_os_family == 'Debian'
- name: Configure cshrc
lineinfile:
path: "/home/{{ item.0.name }}/.cshrc"
line: "{{ item.1.line }}"
state: "{{ item.1.state | default('present')}}"
with_subelements:
- "{{ users }}"
- shell_lines
- skip_missing: true
when: ansible_os_family == 'FreeBSD'

View file

@ -0,0 +1,33 @@
#---
#user_groups:
# - name: mygroup
# gid: 700
# - name: mysecondgroup
# gid: 702
# state: absent
#
#
#users:
# - name: remember
# state: present
# password: "blabla"
# groups:
# - mygroup
# uid: 1100
# keys:
# - file: key1
# state: present
# shell_lines:
# - line: "testline"
# state: present
# - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
# state: present
# - line: "alias ls='ls lah'"
# state: present
# - name: test
# keys:
# - file: key2
# state: absent
# shell_lines:
# - line: "export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh"
# state: present

View file

@ -0,0 +1,8 @@
---
- name: Manage user configuration
hosts: all
# remote_user: root
roles:
- users
- ssh-config