upguard_node - Manage UpGuard Node

New in version 2.3.

Synopsis

  • Manage UpGuard node.
  • CRUD supported.
  • Add node to node group.
  • Create job to scan node.
  • Check mode supported.

Options

parameter required default choices comments
gather_facts
no
  • True
  • False
Return node and group details.
groups
no
  • list
List of group ids and/or group names in which to add the node.
name
yes
    The name of the node.
    node_type
    yes SV
    • SV: Server
    • DT: Desktop
    • SW: Network Switch
    • FW: Firewall
    • RT: Router
    • PH: Smart Phone
    • RB: Robot
    • SS: SAN Storage
    • WS: Website
    The node type. Use two letter code.
    password
    yes
      The password of the Upguard Management Console.
      properties
      no
      • dict
      Properties of the node.
      Invalid or misspelled properties will be ignored.
      Property values are not verified for legitimacy. They will be tried as-is.
      scan
      no
      • True
      • False
      Create a job to scan the node.
      scan_label
      no ansible initiated
        Assign a label to the scan job.
        scan_timeout
        no 120
          Timeout in seconds to wait for the scan job.
          The task will fail if the timeout is reached.
          state
          no
          • present
          • absent
          Create or delete node.
          When state=present facts will be gathered.
          url
          yes
            The url of the Upguard Management Console. Port is optional.
            i.e. https://upguard.example.com[:8443]
            username
            yes
              The username of the Upguard Management Console.
              validate_certs
              no True
              • True
              • False
              Allows connection when SSL certificates are not valid.
              Set to false when certificates are not trusted.

              Examples

              # create/update node
              - upguard_node:
                  url: "https://upguard.example.com"
                  username: "upguard_user"
                  password: "upguard_pass"
                  name: "node_name"
                  node_type: "SV"
                  state: "present"
                  properties:
                      short_description: web server
                      medium_type: 3
                      medium_port: 22
                      operating_system_family_id: 2
              
              # delete node
              - upguard_node:
                  url: "https://upguard.example.com"
                  username: "upguard_user"
                  password: "upguard_pass"
                  name: "node_name"
                  node_type: "SV"
                  state: "absent"
              
              # create/update, add to groups and scan node
              - upguard_node:
                  url: "https://upguard.example.com"
                  username: "upguard_user"
                  password: "upguard_pass"
                  name: "node_name"
                  node_type: "SV"
                  state: "present"
                  scan: true
                  groups:
                    - 100
                    - GroupName
              
              # scan node
              - upguard_node:
                  url: "https://upguard.example.com"
                  username: "upguard_user"
                  password: "upguard_pass"
                  name: "node_name"
                  node_type: "SV"
                  scan: true
              
              # gather facts
              - upguard_node:
                  url: "https://upguard.example.com"
                  username: "upguard_user"
                  password: "upguard_pass"
                  name: "node_name"
                  node_type: "SV"
                  gather_facts: true
                register: results
              

              Return Values

              Common return values are documented here common_return_values, the following are the fields unique to this module:

              name description returned type sample
              node node details either state is present or gather_facts is true dict {'connect_mode': 'f', 'primary_node_group_id': None, 'environment_id': 7, 'operating_system_id': None, 'discovery_type': None, 'medium_password': None, 'updated_at': '2017-02-08T18:07:19.502-05:00', 'node_type': 'SV', 'id': 1120, 'description': None, 'uuid': '686ddbc5-0f6a-4641-af41-5e99f62fe2ac', 'created_by': 8, 'medium_ssl_privkey': None, 'last_scan_id': None, 'mac_address': None, 'short_description': '', 'medium_group': None, 'medium_info': {}, 'status': 1, 'medium_port': 22, 'updated_by': 8, 'medium_username': None, 'alternate_password': None, 'medium_ssl_cert': None, 'online': False, 'scan_options': None, 'last_vuln_scan_at': None, 'ip_address': None, 'info': None, 'organisation_id': 4, 'medium_type': 3, 'name': 'SOME_NODE_NAME', 'operating_system_family_id': None, 'external_id': None, 'created_at': '2017-02-08T02:16:31.962-05:00', 'medium_connection_fail_count': 0, 'last_scan_status': None, 'public': False, 'url': None, 'connection_manager_group_id': None, 'medium_hostname': None}
              groups group details groups are defined and either state is present or gather_facts is true dict {'102': {'status': 1, 'organisation_id': 4, 'description': None, 'node_rules': None, 'search_query': None, 'created_at': '2017-02-08T00:57:47.817-05:00', 'updated_at': '2017-02-08T00:57:47.817-05:00', 'name': 'SOME_GROUP_NAME', 'diff_notify': False, 'scan_options': '{"scan_directory_options":[]}', 'external_id': None, 'id': 102, 'owner_id': None}}
              scan scan job details scan is true dict {'status': -1, 'organisation_id': 4, 'source_name': 'SOME_NODE_NAME', 'updated_by': 8, 'created_at': '2017-02-08T23:46:30.143-05:00', 'updated_at': '2017-02-08T23:46:37.133-05:00', 'created_by': 8, 'scheduled_job_id': None, 'source_type': 11, 'diff_stats': None, 'source_id': 1117, 'stats': None, 'upload_node_id': 1117, 'id': 780}


              Status

              This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

              Support

              This module is community maintained without core committer oversight.

              For more information on what this means please read modules_support

              For help in developing on modules, should you be so inclined, please read community, dev_guide/developing_test_pr and dev_guide/developing_modules.