File tree Expand file tree Collapse file tree
builtin/provisioners/chef Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,12 +71,29 @@ func (p *Provisioner) linuxCreateConfigFiles(
7171 return err
7272 }
7373
74+ // Make sure we have enough rights to upload the hints if using sudo
75+ if p .useSudo {
76+ if err := p .runCommand (o , comm , "chmod 777 " + hintsDir ); err != nil {
77+ return err
78+ }
79+ }
80+
7481 if err := p .deployOhaiHints (o , comm , hintsDir ); err != nil {
7582 return err
7683 }
84+
85+ // When done copying the hints restore the rights and make sure root is owner
86+ if p .useSudo {
87+ if err := p .runCommand (o , comm , "chmod 755 " + hintsDir ); err != nil {
88+ return err
89+ }
90+ if err := p .runCommand (o , comm , "chown -R root.root " + hintsDir ); err != nil {
91+ return err
92+ }
93+ }
7794 }
7895
79- // When done copying the files restore the rights and make sure root is owner
96+ // When done copying all files restore the rights and make sure root is owner
8097 if p .useSudo {
8198 if err := p .runCommand (o , comm , "chmod 755 " + linuxConfDir ); err != nil {
8299 return err
You can’t perform that action at this time.
0 commit comments