diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2014-07-07 23:02:45 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:52:41 +0200 |
commit | 9198e7f8096e9f1b0d5f474cf2345913a357f864 (patch) | |
tree | 940cafc428e311b8ea82d9dad7a59c8bfb9251ac /lib/action_plugins | |
parent | 3e38718677b10faca8970d9b1cc8edc215cce798 (diff) |
Make the Ansible LDAP plugin able to delete entries and attributes.
Use it to delete cn=admin,dc=fripost,dc=org, and to remove the rootDN on
the 'config' database.
Diffstat (limited to 'lib/action_plugins')
-rw-r--r-- | lib/action_plugins/openldap.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/action_plugins/openldap.py b/lib/action_plugins/openldap.py index ee8a991..5dbf59f 100644 --- a/lib/action_plugins/openldap.py +++ b/lib/action_plugins/openldap.py @@ -14,40 +14,43 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import os import pipes import tempfile from ansible.utils import template from ansible import utils from ansible.runner.return_data import ReturnData class ActionModule(object): TRANSFERS_FILES = True def __init__(self, runner): self.runner = runner def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **kwargs): ''' handler for file transfer operations ''' + if self.runner.noop_on_check(inject): + return ReturnData(conn=conn, comm_ok=True, result=dict(skipped=True)) + # load up options options = {} if complex_args: options.update(complex_args) options.update(utils.parse_kv(module_args)) target = options.get('target', None) local = options.get('local', 'no') if local not in [ 'no', 'file', 'template' ]: result = dict(failed=True, msg="local must be in ['no','file','template']") return ReturnData(conn=conn, comm_ok=False, result=result) if local != 'no' and target is None: result = dict(failed=True, msg="target is required in local mode") return ReturnData(conn=conn, comm_ok=False, result=result) if local == 'no': # run the module remotely return self.runner._execute_module(conn, tmp, 'openldap', module_args, inject=inject, complex_args=complex_args) |