Browse Source

Fix a bug with existing CNAME records

Russell Harrison 9 years ago
parent
commit
dbd469ca8a
2 changed files with 5 additions and 1 deletions
  1. 3 1
      roles/lib_dyn/library/dyn_record.py
  2. 2 0
      roles/lib_dyn/tasks/main.yml

+ 3 - 1
roles/lib_dyn/library/dyn_record.py

@@ -224,11 +224,13 @@ def main():
         # First get a list of existing records for the node
         values = get_record_values(dyn_node_records)
         value_key = get_record_key(module.params['record_type'])
+        param_value = module.params['record_value']
 
         # Check to see if the record is already in place before doing anything.
         if (dyn_node_records and
                 dyn_node_records[value_key][0].ttl == module.params['record_ttl'] and
-                module.params['record_value'] in values[value_key]):
+                (param_value in values[value_key] or
+                 param_value + '.' in values[value_key])):
 
             module.exit_json(changed=False)
 

+ 2 - 0
roles/lib_dyn/tasks/main.yml

@@ -3,3 +3,5 @@
 
 - name: Make sure python-dyn is installed
   yum: name=python-dyn state=present
+  tags:
+    - lib_dyn