コード例 #1
0
ファイル: ansible.py プロジェクト: eegilbert/ansible-cmdb
 def update_host(self, hostname, key_values):
     """
     Update a hosts information. This is called by various collectors such
     as the ansible setup module output and the hosts parser to add
     informatio to a host. It does some deep inspection to make sure nested
     information can be updated.
     """
     host_info = self.hosts.get(hostname, {'name': hostname, 'hostvars': {}})
     util.deepupdate(host_info, key_values)
     self.hosts[hostname] = host_info
コード例 #2
0
ファイル: ansible.py プロジェクト: NightKid2/ansible-cmdb
 def update_host(self, hostname, key_values):
     """
     Update a hosts information. This is called by various collectors such
     as the ansible setup module output and the hosts parser to add
     informatio to a host. It does some deep inspection to make sure nested
     information can be updated.
     """
     host_info = self.hosts.get(hostname, {'name': hostname, 'hostvars': {}})
     util.deepupdate(host_info, key_values)
     self.hosts[hostname] = host_info
コード例 #3
0
    def update_host(self, hostname, key_values, overwrite=True):
        """
        Update a hosts information. This is called by various collectors such
        as the ansible setup module output and the hosts parser to add
        informatio to a host. It does some deep inspection to make sure nested
        information can be updated.
        """

        default_empty_host_data = {
            'name': hostname,
            'hostvars': {},
        }

        host_data = self.get(hostname, default_empty_host_data)
        util.deepupdate(host_data, key_values, overwrite=overwrite)

        self._set_host_data(hostname, host_data)