Skip to content

Commit

Permalink
Add dummy struct for integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
efortin committed Jan 21, 2021
1 parent 1cf0dff commit 5523f1e
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 36 deletions.
1 change: 0 additions & 1 deletion internal/ansible/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func (play *Play) AllTags() (tags *utils.Set) {
for _, role := range play.Roles {
tags = tags.Concat(role.AllTags().List())
fmt.Println("role loop tags list is: ", tags.List())

}
tags.Concat(play.Tags.List())
fmt.Println("play tags list is: ", tags.List())
Expand Down
1 change: 0 additions & 1 deletion internal/ansible/playbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func ReadFromFile(osPathname string) (playbook Playbook) {
fmt.Println("No play found inside the playbook: ", osPathname)
return
}

return
}

Expand Down
32 changes: 0 additions & 32 deletions internal/utils/converter.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/utils/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (s *Set) UnmarshalYAML(unmarshal func(i interface{}) error) (err error) {
for _, v := range tmpSlice {
s.m[v] = emptyType{} // add 1 to k as it is starting at base 0
}
fmt.Println("slicedd", s)
fmt.Println("slice string read", s)
return nil
} else if err = unmarshal(&tmpString); err == nil {
strSplits := strings.Split(tmpString, ",")
Expand All @@ -75,7 +75,7 @@ func (s *Set) UnmarshalYAML(unmarshal func(i interface{}) error) (err error) {
for _, v := range strSplits {
s.m[v] = emptyType{} // add 1 to k as it is starting at base 0
}
fmt.Println("slice1", s)
fmt.Println("string", s)
return nil
}
return err
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
param01: param01-value
param02: param02-value
param03: param03-value
Empty file.
14 changes: 14 additions & 0 deletions test/projectSimpleLevel/inventories/customer1/hosts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[all:vars]
platform=os
customer=dploy
env=prod
os=windows

[worker:vars]
volumes_flavors=nvme-1TB

[worker]
worker-001 ansible_host=10.0.0.1 node_alias=node-01
worker-002 ansible_host=10.0.0.2 node_alias=node-02
worker-003 ansible_host=10.0.0.3 node_alias=node-03
worker-004 ansible_host=10.0.0.4 node_alias=node-04
2 changes: 2 additions & 0 deletions test/projectSimpleLevel/roles/existing-role-1/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- { role: add-extra-groupvars }
17 changes: 17 additions & 0 deletions test/projectSimpleLevel/roles/existing-role-1/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


# Gather facts about a particular instance using ID
- name: Gathering Fact to compute aws node ips
ec2_instance_facts:
filters:
instance.group-name: "dploy.{{ dns_iaas_domain }}"
"tag:Tenant": "{{ customer | lower }}"
delegate_to: localhost
register: groupname
run_once: true
tags: test1

- name: Display to host group
delegate_to: localhost
debug: msg="{{ ansible_host }} - {{ inventory_hostname }}"
tags: test3
12 changes: 12 additions & 0 deletions test/projectSimpleLevel/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- hosts: worker
gather_facts: yes
roles:
- { role: existing-role-1, tags: [ "existing-role", "role-1" ] }
tags: playtag1

- hosts: unexisting-group
gather_facts: yes
serial: 100%
roles:
- { role: missingRole, tags: [ "missing-role", "role-2" ] }
tags: playtag2

0 comments on commit 5523f1e

Please sign in to comment.