1- name: nic 2 current host state path group
2  class: group
3  group: path
4  members:
5      - meta: PATH
6        path: /xyz/openbmc_project/state/host3
7      - meta: PATH
8        path: /xyz/openbmc_project/state/host4
9
10- name: current host state property
11  class: group
12  group: property
13  type: string
14  members:
15      - interface: xyz.openbmc_project.State.Host
16        meta: PROPERTY
17        property: CurrentHostState
18
19- name: nic 2 main mode monitor
20  class: watch
21  watch: property
22  paths: nic 2 current host state path group
23  properties: current host state property
24  callback: check if fulfill nic main mode requirement
25
26- name: nic 2 aux mode monitor
27  class: watch
28  watch: property
29  paths: nic 2 current host state path group
30  properties: current host state property
31  callback: check if fulfill nic aux mode requirement
32
33- name: check if fulfill nic main mode requirement
34  class: condition
35  condition: count
36  paths: nic 2 current host state path group
37  properties: current host state property
38  callback: switch nic 2 to main mode
39  countop: ">="
40  countbound: 1
41  op: "=="
42  bound: xyz.openbmc_project.State.Host.HostState.Running
43
44- name: check if fulfill nic aux mode requirement
45  class: condition
46  condition: count
47  paths: nic 2 current host state path group
48  properties: current host state property
49  callback: switch nic 2 to aux mode
50  countop: "=="
51  countbound: 2
52  op: "=="
53  bound: xyz.openbmc_project.State.Host.HostState.Off
54
55- name: switch nic 2 to main mode
56  class: callback
57  callback: method
58  service: org.freedesktop.systemd1
59  path: /org/freedesktop/systemd1
60  interface: org.freedesktop.systemd1.Manager
61  method: StartUnit
62  args:
63      - value: switch-nic-to-main-mode@2.service
64        type: string
65      - value: replace
66        type: string
67
68- name: switch nic 2 to aux mode
69  class: callback
70  callback: method
71  service: org.freedesktop.systemd1
72  path: /org/freedesktop/systemd1
73  interface: org.freedesktop.systemd1.Manager
74  method: StartUnit
75  args:
76      - value: switch-nic-to-aux-mode@2.service
77        type: string
78      - value: replace
79        type: string
80