/var/lib/phoronix-test-suite/test-results/
it has 3 subdirs:
2018-04-22-1850 2018-04-23-1850 2018-04-24-1850
and a tiny file in each: composite.xml
part of it's content:
<Result> <Identifier>pts/ramspeed-1.4.1</Identifier> <Title>RAMspeed SMP</Title> <AppVersion>3.5.0</AppVersion> <Arguments>ADD -b 3</Arguments> <Description>Type: Add - Benchmark: Integer</Description> <Scale>MB/s</Scale> <Proportion>HIB</Proportion> <DisplayFormat>BAR_GRAPH</DisplayFormat> <Data> <Entry> <Identifier>4096 MB RAM - Intel Core</Identifier> <Value>19292.13</Value> <RawString></RawString> <JSON>{"compiler-options":{"compiler-type":"CC","compiler":"gcc","compiler-options":"-O3 -march=native"}}</JSON> </Entry> </Data> </Result>
I want to replace <Identifier>pts/ramspeed-1.4.1</Identifier> with {{ ansible_host }} {{ dirname }}
let's say:
grep Identifier /var/lib/phoronix-test-suite/test-results/2018-04-24-1850/composite.xml *<Identifier>hostname 2018-04-24-1850</Identifier>*
I have build some playbook, here is my "sample" config:
- name: Set the /PhoronixTestSuite/System/Identifier={{ ansible_host }} xml: path: /var/lib/phoronix-test-suite/test-results/*/composite.xml xpath: /PhoronixTestSuite/System/Identifier value: "{{ ansible_host }}" - name: Set the /PhoronixTestSuite/Result/Data/Entry/Identifier={{ ansible_host }} xml: path: /var/lib/phoronix-test-suite/test-results/*/composite.xml xpath: /PhoronixTestSuite/Result/Data/Entry/Identifier value: "{{ ansible_host }}"
but it do not do what I want, maybe you could help?
I have used this:
I think this can be done using local facts for more tiny/neat/nice/cute look. but it is good for now.