Sha256: 2630df9fb9b5894656ed99ab9f8466989e544178ca7f3b27f116610c97d65298

Contents?: true

Size: 504 Bytes

Versions: 37

Compression:

Stored size: 504 Bytes

Contents

module ForemanAnsible
  # Service to generate a playbook given roles and a list of hosts
  class PlaybookCreator
    attr_reader :role_names

    def initialize(role_names)
      @role_names = role_names
    end

    def roles_playbook
      playbook = ['hosts' => 'all', 'roles' => role_names]
      playbook.to_yaml
    end

    def roles_tempfile
      tempfile = Tempfile.new("foreman-ansible-#{fqdn}-roles")
      tempfile.write(roles_playbook)
      tempfile.close
      tempfile
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
foreman_ansible-2.2.14 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.13 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.12 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.11 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.10 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.9 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.8 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.7 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.6 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.5 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.4 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.3 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.2 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.2.0 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.1.2 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.1.1 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.0.4 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.0.3 app/services/foreman_ansible/playbook_creator.rb
foreman_ansible-2.0.2 app/services/foreman_ansible/playbook_creator.rb