Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_service_profile_association.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs.ucs_ucs_service_profile_association
3 - hosts: ucs
4 connection: local
5 gather_facts: false
6
7 tasks:
8 - name: Test that we have a UCS hostname, UCS username, and UCS password
9 fail:
10 msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
11 when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
12 vars:
13 # use "<<: *login_info" to substite the information below in each task
14 # this is not required, however it makes the playbook shorter.
15 login_info: &login_info
16 hostname: "{{ ucs_hostname }}"
17 username: "{{ ucs_username }}"
18 password: "{{ ucs_password }}"
19
20 - name: Change Service Profile Association to Existing Server
21 cisco.ucs.ucs_service_profile_association:
22 <<: *login_info
23 service_profile_name: auto-profile-2
24 server_assignment: server
25 server_dn: sys/chassis-6/blade-1
26 delegate_to: localhost
27 register: result
28 until: result.assign_state == 'assigned' and result.assoc_state == 'associated'
29 retries: 1
30 delay: 2
31 ignore_errors: true
32
33 - name: Change Service Profile Association to Pool
34 cisco.ucs.ucs_service_profile_association:
35 <<: *login_info
36 service_profile_name: auto-profile-2
37 server_assignment: pool
38 server_pool_name: default
39 delegate_to: localhost
40 register: result
41 until: result.assign_state == 'assigned' and result.assoc_state == 'associated'
42 retries: 1
43 delay: 2
44 ignore_errors: true
45
46 - name: Disassociate Service Profile
47 cisco.ucs.ucs_service_profile_association:
48 <<: *login_info
49 service_profile_name: auto-profile-2
50 state: absent
51 delegate_to: localhost
52 register: result
53 until: result.assign_state == 'unassigned' and result.assoc_state == 'unassociated'
54 retries: 1
55 delay: 2
56 ignore_errors: true